I have a couple of UIViewControllers and related nib files. I can call either of them from another UIView controller ("Sta开发者_如何学JAVArtController") by pressing a button for each one. Each of the called UIViewControllers had a button which I've connected up to a related method which pops the view off the stack, like so:
[self.navigationController popViewControllerAnimated:YES];
The methods for both are coded in the their respective implementation classes, like this:
- (IBAction) validateEntries{
// some validation goes here
[self.navigationController popViewControllerAnimated:YES];
}
and this:
-(IBAction) returnToStart {
NSLog(@"returnToStart method called");
[self.navigationController popViewControllerAnimated:YES];
}
They both have the methods declared in their respective interface files:
-(IBAction) returnToStart;
and
-(IBAction)validateEntries;
And the buttons in the nibs are connected to these respectively via the "touch up inside" event. The first one works fine, but the second doesn't - it doesn't even call the method. I don't get what could be causing this. Any ideas?
sounds like you dont actually have the button hooked up to the right method inside IB if the method isnt ever being called
精彩评论