Skip to content

Instantly share code, notes, and snippets.

@CH3COOH
Created May 29, 2013 15:17
Show Gist options
  • Select an option

  • Save CH3COOH/5671102 to your computer and use it in GitHub Desktop.

Select an option

Save CH3COOH/5671102 to your computer and use it in GitHub Desktop.
iOSで遅延起動させてみた
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
//self.window.rootViewController = self.viewController;
//[self.window makeKeyAndVisible];
NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://ch3cooh.jp/"]];
[NSURLConnection sendAsynchronousRequest:req
queue:[[NSOperationQueue alloc] init]
completionHandler:^(NSURLResponse *res, NSData *data, NSError *error) {
// なんか重たい処理とかやってる想定
[NSThread sleepForTimeInterval:10];
dispatch_async(dispatch_get_main_queue(), ^{
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
});
}];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment