0
我需要在應用程序開始時顯示「加載屏幕」(只是一個圖像),當應用程序從網絡獲取所有需要的數據時,將顯示第一個視圖控制器。我已經succeded通過設置自己黑屏「爲Default.png」爲「LoadingScreen.png」做和iPhone加載屏幕直到網頁請求完成
(重新命名爲爲Default.png當然)- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[THWViewController alloc] initWithNibName:@"THWViewController" bundle:nil];
[self performSelector:@selector(start) withObject:nil afterDelay:5.0];
[self.window makeKeyAndVisible];
return YES;
}
- (void)start
{
self.window.rootViewController = self.viewController;
}
我會改變這種隨機延遲到API負載時已完成,但這是實施它的好方法嗎?因爲我得到的消息是rootviewcontroller預計。