Weird error after snapping picture


When I take a picture and hit “use” the application freezes and the following message is sent to the console:

Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UIImage getFileSystemRepresentation:maxLength:]: unrecognized selector sent to instance 0x1e858240’

I went through all the methods I implemented in this chapter and there are no syntax errors. The debugger highlights a line in the main function and it shows a “Thread 1:signal SIGABRT” error. Any idea what this is referring to?


It turns out that in this method:

  • (void)setImage:(UIImage *)i forKey:(NSString *)s

I typed [self imageForKey] where I was supposed to use [self imagePathForKey]. Silly mistake on my part.