두 가지보기가 있습니다. 하나의보기는 등록보기입니다. 사용자가 등록 UIBarButtonItem을 클릭하면 해당 뷰로 이동합니다. 이보기에는 "Back"이라고하는 또 다른 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]
'등록'개체에 'signUp :'이라는 메서드가 있습니까? –
당신이 이것을 검색했다면 12 가지 설명을 찾을 수 있습니다. 오류 메시지를주의 깊게 읽으면 설명없이 이해할 수 있습니다. 너의 숙제를해라! –
인터페이스에서이 메소드가 없거나 인터페이스의 선언이 누락 된 등록 객체로 signUp 메시지를 보내고 있습니다. –