Problem using the Simulator


#1

I am using the simulator to test my app… I have added pictures to the Photo Library on the Simulator, but when I click on a Possession, then click the Camera button the app freezes and doesn’t open the Photo Library like it should.

When I open the Console this is what I get :

2010-09-23 19:10:30.634 Homepwner[1152:207] ******* Accessibility Status Changed: On 2010-09-23 19:10:30.703 Homepwner[1152:207] ********** Loading AX for: com.yourcompany.Homepwner ************ 2010-09-23 19:10:33.548 Homepwner[1152:207] -[ItemDetailViewController takePicture]: unrecognized selector sent to instance 0x596cef0 2010-09-23 19:10:33.550 Homepwner[1152:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ItemDetailViewController takePicture]: unrecognized selector sent to instance 0x596cef0' *** Call stack at first throw: ( 0 CoreFoundation 0x02391919 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x024df5de objc_exception_throw + 47 2 CoreFoundation 0x0239342b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3 CoreFoundation 0x02303116 ___forwarding___ + 966 4 CoreFoundation 0x02302cd2 _CF_forwarding_prep_0 + 50 5 UIKit 0x002b5e14 -[UIApplication sendAction:to:from:forEvent:] + 119 6 UIKit 0x004bd14b -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 156 7 UIKit 0x002b5e14 -[UIApplication sendAction:to:from:forEvent:] + 119 8 UIKit 0x0033f6c8 -[UIControl sendAction:to:forEvent:] + 67 9 UIKit 0x00341b4a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 10 UIKit 0x003406f7 -[UIControl touchesEnded:withEvent:] + 458 11 UIKit 0x002d92ff -[UIWindow _sendTouchesForEvent:] + 567 12 UIKit 0x002bb1ec -[UIApplication sendEvent:] + 447 13 UIKit 0x002bfac4 _UIApplicationHandleEvent + 7495 14 GraphicsServices 0x02bf7afa PurpleEventCallback + 1578 15 CoreFoundation 0x02372dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 16 CoreFoundation 0x022d3737 __CFRunLoopDoSource1 + 215 17 CoreFoundation 0x022d09c3 __CFRunLoopRun + 979 18 CoreFoundation 0x022d0280 CFRunLoopRunSpecific + 208 19 CoreFoundation 0x022d01a1 CFRunLoopRunInMode + 97 20 GraphicsServices 0x02bf62c8 GSEventRunModal + 217 21 GraphicsServices 0x02bf638d GSEventRun + 115 22 UIKit 0x002c3b58 UIApplicationMain + 1160 23 Homepwner 0x0000217c main + 102 24 Homepwner 0x0000210d start + 53 ) terminate called after throwing an instance of 'NSException'

I have checked my methods many times and I cannot figure out what would be causing this.

Any suggestions?


#2

Remember that method names include the colons. When you create the cameraButton, you specify an action for that button. You have @selector(takePicture). You should have @selector(takePicture:).


#3

And there it was… I went over the code a bunch of times before I posted but I missed that…

I went on with the chapter but it was bugging me that it wasn’t working.

Thanks!