Bạn cần sử dụng mẫu Ứng dụng chi tiết chính. Chọn Gia đình thiết bị từ danh sách thả xuống dưới dạng iPhone. Sau khi tạo dự án, appDelegate của bạn sẽ chứa ví dụ UINavigationController
.
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *navigationController;
@end
và
@implementation AppDelegate
@synthesize window = _window;
@synthesize navigationController = _navigationController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil] autorelease];
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
Tương tự như câu hỏi: http://stackoverflow.com/questions/8196123/replacement-for-navigation-based-application-template-in-xcode-4-2?lq=1 –