JSON Change From App Store Crashing Old Apps

Starting yesterday, and all day today (October 26, 2018), we are seeing crashes in our old apps (that have run crash-free for years) because of what I am certain was a change in how itunes.apple.com/us/search is returning the "trackId" in the JSON for the apps returned by the search.


NSArray *results = [jsonObject objectForKey:@"results"];
NSDictionary *result = [results objectAtIndex:0]; // This assumes at least one result. Actual code checks first.
NSNumber *appId = [result objectForKey:@"trackId"];
NSString *appIdString = [appId stringValue]; // <-- This did not used to crash, but now it does!


The crash says "-[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0x9ce1c85ef84eaf0b"


The fix is to replace 04. above with:


NSString *appIdString = [NSString stringWithFormat:@"%@", appId];


Or you could just note that "trackId" is already a JSON string, which is where I think the change was made.

Replies

Yes!! I've noticed this also. It appears that itunes.apple.com/search is changing from under our feet. 😠


The trackId was an integer, then changed to a string, now (today) is back to an integer. Not sure what to make of it. 😕