I have seen something here[1] that states that I can remove these errors in xcode 3 by changing a method like -(IBAction) shakeShakeShake to -(IBAction) shakeShakeShake (id) sender
I am using iphone sdk 3.0 and xcode 3.2.1 on snow leopard
My errors are:
Classes/MainViewController.m:156: warning: 'MainViewController' may not respond to '-shakeShakeShake'
/Users/temp/Desktop/src/Count Down Timer (Utility App)/Classes/MainViewController.m:156:0 /Users/temp/Desktop/src/Count Down Timer (Utility App)/Classes/MainViewController.m:156: warning: (Messages without a matching method signature
Classes/MainViewController.m: At top level:
Classes/MainViewController.m:467: warning: incomplete implementation of class 'MainViewController'
Classes/MainViewController.m:467: warning: method definition for '-pickerView:' not found
Classes/MainViewController.m:467: warning: method definition for '-shakeShakeShake:' not found
----- (sorry about the long error msgs, I tried to cut them down by removing compiler and path info) ---
I have tried adding things like
-(void)shakeShakeShake: (id) sender ;
as a prototype to the .h file and to the .m file
- (IBAction) shakeShakeShake: (id) sender {
dimView.alpha = 0.0f ; }
Making these changes will make the warning go away, but when I run my program and execute this function, it will exit to the Springboard with a console message:
[MainViewController shakeShakeShake]: unrecognized selector sent to instance 0x1213a20 2009-12-21 02:19:17.389 Count Down Timer (Utility App)[43704:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[MainViewController shakeShakeShake]: unrecognized selector sent to instance 0x1213a20'
When I change the function back to - (IBAction) shakeShakeShake { (even if I leave the prototype style in with : (id) sender), the program (a simple utility timer) runs fine and gives no errors to the console.
I can't seem to figure out what I'm doing wrong, but I was always taught to remove warnings if possible as they may note problems that only surface later and are hard to find.
Can anyone point me in the right direction here? thanks very much for your patience, I'm still new at this! ;-)
Thanks Piesia
BTW, shakeShakeShake is called here:
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
if (event.type == UIEventSubtypeMotionShake) { //Your code here [ self shakeShakeShake ] ; } }
---- error msgs follow
Classes/FlipsideViewController.m:401: warning: incomplete implementation of class 'FlipsideViewController' Classes/FlipsideViewController.m:401: warning: method definition for '-pickerView:' not found Classes/FlipsideViewController.m:401: warning: method definition for '-shakeShakeShake' not found