My code works some times but at times throws the following exception. Is this error related to memory management? What do I look for? The code is specified later. Help appreciated. Thanks
iNMV[1067:307]
-[__NSCFType stringByAppendingString:]: unrecognized selector sent to instance 0x10dc90.
iNMV[1067:307] Exception: Caught NSInvalidArgumentException:
-[__NSCFType stringByAppendingString:]: unrecognized selector sent to instance 0x10dc90
NSString *url = [realURLArray objectAtIndex:page * [svc maxNumberOfImages] + i];
NSString *thumbUrl = [url stringByAppendingString:@".128x128.jpg"];
Add breakpoints for
objc_exception_throw,-[NSException raise], andmalloc_error_break(I set these for all projects). Then debug your app (run with breakpoints enabled) and when your encounter that exception, find your block of code and inspect the values of your variables.Also, are you sure about the math? If your page numbers start at 1, you have 10 images per page, and you want the image at i=5, then your math is going to give you image 15, not image 5.