我的應用程序在模擬器中工作正常,但是當我在我的手機上運行它,我得到這個錯誤:無法識別的選擇發送到實例
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'
它發生在這裏:
-(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];
}
它崩潰這個行:
methodViewController.referringObject = selectedObject;
不知道如何,我敢肯定,這是相當基本解決,任何解決這個,因爲它的工作原理在模擬器幫助將不勝感激。
確實MethodViewController有referringObject財產? – Chuck 2010-04-05 20:52:42
是的,它在模擬器中工作沒有錯誤,不明白爲什麼它不在手機上。 – iamsmug 2010-04-05 21:14:00
用'@ property'定義顯示代碼行。 – 2010-04-05 21:49:35