How come this won’t switch views for me? When I click the button it does nothing…
-(IBAction)howtoplayButtonClicked{
howToPlayViewController = [[HowToPlayViewController alloc] initWithNibName:@"HowToPlayViewController" bundle:nil];
[self.navigationController pushViewController:howToPlayViewController animated:YES];
[HowToPlayViewController release];
}
in the .h file I have this…
#import <UIKit/UIKit.h>
#import "HowToPlayViewController.h"
@interface PopToItViewController : UIViewController {
HowToPlayViewController *howToPlayViewController;
}
-(IBAction)howtoplayButtonClicked;
@end
Your action method…
… should look like this:
In it’s improper form it might not be called. If correcting the form does not work, you should:
You don’t need
howToPlayViewControllerset as property if your initializing it from nib and then releasing it. Generally you would only use a property if you wanted to wire it up in Interface Builder in which case it should be defined like so:IBOutlet HowToPlayViewController *howToPlayViewController;