Created
May 29, 2013 15:17
-
-
Save CH3COOH/5671102 to your computer and use it in GitHub Desktop.
iOSで遅延起動させてみた
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (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