Ios NSInvalidArgumentException:发送到实例的选择器无法识别
当我运行应用程序时,出现以下错误:Ios NSInvalidArgumentException:发送到实例的选择器无法识别,ios,variables,compiler-errors,iboutlet,Ios,Variables,Compiler Errors,Iboutlet,当我运行应用程序时,出现以下错误: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [UIRoundedRectButton copyWithZone:]: unrecognized selector sent to instance 0xcc86970' 为什么我会犯这样的错误?我仔细检查了所有IBE插座的连接和所有IBAction。这是我的代码:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-
[UIRoundedRectButton copyWithZone:]: unrecognized selector sent to instance
0xcc86970'
为什么我会犯这样的错误?我仔细检查了所有IBE插座的连接和所有IBAction。这是我的代码:
MenuViewController.h
@interface MenuViewController : UIViewController
<UITableViewDelegate, UITableViewDataSource>{
}
@property (nonatomic, copy) IBOutlet UITableView * tableView;
@property (nonatomic,copy) IBOutlet UILabel *labelTitle;
@property (nonatomic, copy) IBOutlet UIButton *buttonHome;
@property (nonatomic, copy) IBOutlet UIButton *buttonMap;
@property (nonatomic, copy) IBOutlet UIButton *buttonFavorites;
-(IBAction) pressedHome:(id)sender;
-(IBAction) pressedMap: (id)sender;
-(IBAction) pressedFavorites: (id)sender;
@end
提前感谢您删除以下属性
@property (nonatomic) IBOutlet UITableView * tableView;
@property (nonatomic) IBOutlet UILabel *labelTitle;
@property (nonatomic) IBOutlet UIButton *buttonHome;
@property (nonatomic) IBOutlet UIButton *buttonMap;
@property (nonatomic) IBOutlet UIButton *buttonFavorites;
删除以下属性的
copy
@property (nonatomic) IBOutlet UITableView * tableView;
@property (nonatomic) IBOutlet UILabel *labelTitle;
@property (nonatomic) IBOutlet UIButton *buttonHome;
@property (nonatomic) IBOutlet UIButton *buttonMap;
@property (nonatomic) IBOutlet UIButton *buttonFavorites;
删除
副本
。发生这种情况是因为UIButton(和其他uicontrol)不符合NSCopying
协议,因此复制它们的调用失败。删除复制
。发生这种情况是因为UIButton(和其他uicontrol)不符合NSCopying
协议,因此复制它们的调用失败。您想对此做什么?你能添加一些评论吗?这就足够修复撞车了,但是你想怎么做呢?你能添加一些评论吗?这足以修复崩溃,但是