FinalViewWithSending *newView = [[FinalViewWithSending alloc]initWithNibName:@"FinalViewWithSending" bundle:nil];
newView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:newView animated:YES]; //it crashes here with a thread 1 error, SIGABRT error..

它说:
"Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<FinalViewWithSending 0x1bef70> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key loginButton.'"

没有名为loginButton的变量,所以我不确定为什么我遇到错误...

谢谢

最佳答案

您收到错误,因为没有名为loginButton的属性。检查您的.xib文件。几乎可以肯定有一个指向FinalViewWithSending对象(可能是File的Owner)的错误链接,该对象指定了loginButton,即使该类在类代码中不存在。

关于xcode - setValue:forUndefinedKey:]:,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9950938/

10-11 22:41