Adr*_*lli 1 variables compiler-errors iboutlet ios
当我运行我的应用程序时,我收到此错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-
[UIRoundedRectButton copyWithZone:]: unrecognized selector sent to instance
0xcc86970'
Run Code Online (Sandbox Code Playgroud)
为什么我会收到这样的错误?我小心翼翼地检查IBOutlets的所有连接e所有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
Run Code Online (Sandbox Code Playgroud)
在MenuViewController.m中
-(IBAction) pressedHome:(id)sender{
MenuViewController * menu =[[MenuViewController alloc]initWithNibName:@"MenuViewController" bundle:nil];
[self.navigationController pushViewController:menu animated:YES];
}
-(IBAction) pressedMap: (id)sender{
MapViewController * map =[[MapViewController alloc]initWithNibName:@"MapViewController" bundle:nil];
[self.navigationController pushViewController:map animated:YES];
}
-(IBAction) pressedFavorites: (id)sender{
FavoritesViewController * favorites =[[FavoritesViewController alloc]initWithNibName:@"FavoritesViewController" bundle:nil];
[self.navigationController pushViewController:favorites animated:YES];
}
Run Code Online (Sandbox Code Playgroud)
提前致谢
| 归档时间: |
|
| 查看次数: |
3625 次 |
| 最近记录: |