次のことを行ってください:
AppDelegate.h 内
@property (nonatomic, retain) UINavigationController *navigationController;
AppDelegate.m 内
@implementation AppDelegate
@synthesize navigationController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
}
self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
次のviewcontrollerをプッシュしたい場合は、上記のコードを書くことができます:
-(void)fontButtonPress{
FontViewController *fontViewController = [[FontViewController alloc] initWithNibName:@"FontViewController_iPhone" bundle:nil];
[self.navigationController pushViewController:fontViewController animated:YES];
}
何か問題があればお知らせください。
ありがとう