我有两种看法。一种视图是注册视图。当用户单击注册 UIBarButtonItem 时,它会将他们带到该视图。在该视图上,还有另一个 UIBarbuttonitem 显示“返回” - 因此当用户单击该按钮时,它会将他们带到上面有注册按钮的主视图。然后如果用户再次点击注册按钮,就会抛出这个错误;
2012-09-26 19:22:53.256 Users[14763:c07] -[Registration signUp:]: unrecognized selector sent to instance 0x747e5b0
2012-09-26 19:22:53.257 Users[14763:c07] *** Terminating app due to uncaught exception
UsersViewController.h
@interface UsersViewController : UIViewController
@property (nonatomic, strong) Registration *registration;
UsersViewController.m
Signup event:
self.registration = [[Registration alloc]initWithNibName:@"Registration" bundle:nil];
[self.view addSubview:self.registration.view];
Registration.h
@interface Registration : UIViewController
@property (nonatomic, strong) Registration *mainView;
Registration.m
Back button Event
self.mainView = [[Registration alloc]initWithNibName:@"UsersViewController" bundle:nil];
[self.view addSubview:self.mainView.view]