귀하의 SampleViewController이 창 계층 구조에서, 당신은 설정할 필요가 없습니다 SampleViewController에 UINavigationController가를 제시하는 시도 창에서.
AppDelegate에에서
, 다음과 같이 수행
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[SampleViewController alloc] initWithNibName:@"SampleViewController" bundle:nil];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
당신이 didFinishLaunchingWithOptions 메소드에서 다음과 같이 사용 storyboad를 사용하는 경우, 뷰 컨트롤러에서
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
bundle: nil];
SampleViewController *mainViewController = (SampleViewController*)[mainStoryboard
instantiateViewControllerWithIdentifier: @"SampleViewController"];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:mainViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window setRootViewController:navigationController];
[self.window setBackgroundColor:[UIColor whiteColor]];
[self.window makeKeyAndVisible];
return YES;
}
,
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *action_9 = [defaults objectForKey:@"url"];
if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"url"] isEqualToString:@"aa9"])
{
inboxData *screen=[[inboxData alloc]initWithNibName:@"inboxData" bundle:nil];
[email protected]"1";
[self presentModalViewController:screen animated:YES];
}
}
창에 탐색 컨트롤러를 추가해야합니다. self.window.rootViewController = self.navigationController; – karthika
@karthika thanx 4 ur time..can 더 자세한 정보가있을 수 있습니까? xcode에 익숙한 초보자입니다. – user2767343