I have an app which has been extensively tested with iOS 6 and works well, while on iOS 7 it crashes almost always (but not 100% times) with an Thread 1: EXC_BAD_ACCESS
error in the main, without much to trace. I am completely clueless of its whereabouts. I believe something in my code is not compatible with the core iOS methods.
The best I could identify is, upon commenting the following part of the code everything runs well.
UIGraphicsBeginImageContext(coverView.bounds.size);
[coverView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *coverImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[UIImageJPEGRepresentation(coverImage, 0.8f) writeToFile:coverFilePath atomically:YES];
//Create thumbnail of cover image
CGSize size = CGSizeMake(116.0f, 152.0f);
UIGraphicsBeginImageContext(size);
[coverImage drawInRect:CGRectMake(0.0f, 0.0f, size.width, size.height)];
coverImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[UIImageJPEGRepresentation(coverImage, 0.8f) writeToFile:coverThumbnailFilePath atomically:YES];
Can anyone suggest me where I should go debugging next? Kindly note that the same App works fantastic in iOS 6 and this bug is very much iOS 7 specific.
EDIT: The zombie stack trace is attached: I could not make use of it much so far, but might be useful for expert eyes :)
Thanks in advance,
Nikhil