0
가능한 중복 : 나는 응용 프로그램을 만들어 특정 뷰가 기본적으로 처음 열리고, 내가 바꾸려고한다면
How to change the default View Controller that is loaded when app launches?변경 (엑스 코드)
어떤 견해가 먼저 열리는가, 나는 그것을 어떻게 할 것인가?
가능한 중복 : 나는 응용 프로그램을 만들어 특정 뷰가 기본적으로 처음 열리고, 내가 바꾸려고한다면
How to change the default View Controller that is loaded when app launches?변경 (엑스 코드)
어떤 견해가 먼저 열리는가, 나는 그것을 어떻게 할 것인가?
didFinishLaunchingWithOptions라고하는 AppDelegate.m 파일의 메서드 (또는 응용 프로그램 대리자 파일의 제목)가 제어됩니다. 예를 들어, 탭 표시 줄 응용 프로그램에서 나는 다음과 같습니다 만들었습니다
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Add the tab bar controller's current view as a subview of the window
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
당신이해야 할 self.window.rootViewController의 값을 변경합니다. 예를 들어, MapViewController가 첫 번째 페이지로 열리길 원한다고 가정 해 봅시다. 다음과 같이 할 수 있습니다.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Add the tab bar controller's current view as a subview of the window
MapViewController *mvc = [[MapViewController alloc]initWithNibName:@"MapViewController" bundle:nil]; //Allocate the View Controller
self.window.rootViewController = mvc; //Set the view controller
[self.window makeKeyAndVisible];
[mvc release]; //Release the memory
return YES;
}