我尝试在nstimer之后打开新屏幕并且我正在使用:
MultiplayerController* controller = [[MultiplayerController alloc] initWithNibName:@"MultiplayerController" bundle:nil];
[[self navigationController] pushViewController:controller animated:YES];
[controller.playeronecount setText:playeronecount.text];
但该应用程序正在给我一个SIGABRT。
<。>文件中的;
IBOutlet UILabel *playeronecount;
@property (nonatomic, retain) UILabel *playeronecount;
2012-01-12 21:56:16.016 [9621:707] - [MultiplayerController playeronecount]:无法识别的选择器发送到实例0x39824a0 2012-01-12 21:56:16.020 [9621:707] *由于未被捕获而终止应用程序 异常'NSInvalidArgumentException',原因: ' - [MultiplayerController playeronecount]:发送无法识别的选择器 例子0x39824a0' * 第一次抛出调用堆栈:(0x33ff48bf 0x357101e5 0x33ff7acb 0x33ff6945 0x33f51680 0x5f85 0x31ac361d 0x33fc8a63 0x33fc86c9 0x33fc729f 0x33f4a4dd 0x33f4a3a5 0x35b8afcd 0x3508f743 0x275f 0x2704) 终止调用抛出异常(gdb)
答案 0 :(得分:2)
您需要@synthesize
playeronecount
才能分别生成getter和setter方法-playeronecount
和-setplayeronecount
。尝试在没有合成这些方法的情况下访问属性将导致“无法识别的选择器发送到实例”异常。