'Undeclared Selector' error


#1

Any ideas as to the cause of this? Thanks again!

I am getting the above error related to this code:

// Configure the Insert button's action to call this object's -addTask: method
    
    [insertButton addTarget:self action:@selector(addTask:) forControlEvents:UIControlEventTouchUpInside];
    

This is the error message:

2013-10-16 21:31:05.680 iTahDoodle[448:a0b] Application windows are expected to have a root view controller at the end of application launch
2013-10-16 21:31:14.088 iTahDoodle[448:a0b] -[BNRAppDelegate addTask:]: unrecognized selector sent to instance 0x8d18020
2013-10-16 21:31:14.091 iTahDoodle[448:a0b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[BNRAppDelegate addTask:]: unrecognized selector sent to instance 0x8d18020’
*** First throw call stack:
(
0 CoreFoundation 0x017355e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014b88b6 objc_exception_throw + 44
2 CoreFoundation 0x017d2903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0172590b forwarding + 1019
4 CoreFoundation 0x017254ee _CF_forwarding_prep_0 + 14
5 libobjc.A.dylib 0x014ca874 -[NSObject performSelector:withObject:withObject:] + 77
6 UIKit 0x0022cc8c -[UIApplication sendAction:to:from:forEvent:] + 108
7 UIKit 0x0022cc18 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
8 UIKit 0x003246d9 -[UIControl sendAction:to:forEvent:] + 66
9 UIKit 0x00324a9c -[UIControl _sendActionsForEvents:withEvent:] + 577
10 UIKit 0x00323d4b -[UIControl touchesEnded:withEvent:] + 641
11 UIKit 0x0026a0cd -[UIWindow _sendTouchesForEvent:] + 852
12 UIKit 0x0026ad34 -[UIWindow sendEvent:] + 1232
13 UIKit 0x0023ea36 -[UIApplication sendEvent:] + 242
14 UIKit 0x00228d9f _UIApplicationHandleEventQueue + 11421
15 CoreFoundation 0x016be8af CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
16 CoreFoundation 0x016be23b __CFRunLoopDoSources0 + 235
17 CoreFoundation 0x016db30e __CFRunLoopRun + 910
18 CoreFoundation 0x016dab33 CFRunLoopRunSpecific + 467
19 CoreFoundation 0x016da94b CFRunLoopRunInMode + 123
20 GraphicsServices 0x036869d7 GSEventRunModal + 192
21 GraphicsServices 0x036867fe GSEventRun + 104
22 UIKit 0x0022b94b UIApplicationMain + 1225
23 iTahDoodle 0x0000288d main + 141
24 libdyld.dylib 0x01d71725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)


#2

You have a typo. In the previous thread your method was shown as addtask: - should be addTask:. Clean that up and you should be good to go.

Mitch


#3

[quote=“mitchb”]You have a typo. In the previous thread your method was shown as addtask: - should be addTask:. Clean that up and you should be good to go.

Mitch[/quote]

Oh man, I want to die.

Thanks very much for the help. I am learning how to look at code and see where I am messing up, but I must have looked at that for an hour and didn’t see it. Needless to say, I still have a ways to go.

Thanks again!