unrecognized selector sent to instance
- by iamsmug
My app works fine in the simulator but when I run it on my phone I get this error:
2010-04-05 21:32:45.119 Top
Banana[119:207] * Terminating app
due to uncaught exception
'NSInvalidArgumentException', reason:
'* -[MethodViewController
setReferringObject:]: unrecognized
selector sent to instance 0x16e930'
It happens here:
-(void)method {
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.50];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
MethodViewController *methodViewController = [[MethodViewController alloc] initWithNibName:@"MethodViewController" bundle:0];
NSManagedObject *selectedObject = self.referringObject;
methodViewController.referringObject = selectedObject;
[self.navigationController pushViewController:methodViewController animated:NO];
methodViewController.title = @"Method";
[UIView commitAnimations];
[MethodViewController release];
}
It crashes on this line:
methodViewController.referringObject = selectedObject;
Not sure how to resolve this as it works in the simulator, I'm sure it is fairly basic to fix, any help will be appreciated.