I think I have a conceptual misunderstanding and would appreciate an explanation.
Within a class, I had the same block of code repeating 3 times (and working perfectly) but to try to make things more "efficient" I took it out and made a method within the class as follows:
- (void)dateUP {
NSLog(@"dateUp");
[UIView beginAnimations:@"datePicker" context:nil];
[UIView setAnimationDuration:0.5];
datePicker.transform = CGAffineTransformMakeTranslation(0,-310);
[UIView commitAnimations];
}
and then where the code originally was, I put:
[self dateUp];
and I put the following in my .h:
-(void)dateUp;
I build and get this warning:
Line Location DetailPopUpView.m:165: warning: method definition for '-dateUp'
not found
and a crash with this in the console (and btw, the NSLog statement doesn't appear in the console):
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[DetailPopUpView dateUp:]: unrecognized selector sent to instance
0x3d33ef0'
Any help appreciated. One thing that I notice is that the console message has dateUp: (with a colon) as if a parameter is expected. So whereas the simplest solution is just to put the code back, repeating it 3x, I'd like to know what I'm doing wrong.
Thanks.