I have just commenced the Apple “Your First iPhone App’ tutorial and encountered a problem when attempting to run the app in the simulator.
I can enter my name and selecting the Done button makes the keyboard disappear, however I get an error once I press the Hello button. The log from Xcode reads;
2012-10-27 00:24:17.044 Hello World 2[955:c07] -[HelloWorldViewController changegreeting:]: unrecognized selector sent to instance 0x897c1a0
2012-10-27 00:24:17.047 Hello World 2[955:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[HelloWorldViewController changegreeting:]: unrecognized selector sent to instance 0x897c1a0'
*** First throw call stack:
(0x1c8e012 0x10cbe7e 0x1d194bd 0x1c7dbbc 0x1c7d94e 0x10df705 0x16920 0x168b8 0xd7671 0xd7bcf 0xd6d38 0x4633f 0x46552 0x243aa 0x15cf8 0x1be9df9 0x1be9ad0 0x1c03bf5 0x1c03962 0x1c34bb6 0x1c33f44 0x1c33e1b 0x1be87e3 0x1be8668 0x1365c 0x263d 0x2565 0x1)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Can anyone help? I’ve gone over the project twice and get the same error each time I run it.
From the console log:
it seems you are calling a
changegreeting:method on an instance ofHelloWorldViewController, but the method is not found, so the call fails.Now this can come down to 2 things:
you sent the message to the wrong object;
the method signature does not correspond to the way you are calling it: either the method name is different (
changeGreeting:?) or it does not take an argument…Hope this helps.