-1
私のiosアプリには、Google、Facebook、Twitterの統合が含まれています。アプリケーションが起動すると、UIをロードする前にAPIがロードされます。マルチスレッドiOS、ファストラウンチUI
UIをマルチスレッドにする方法まず最初に高速起動をロードします。私のdidFinishLaunchingWithOptionsはです。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Add code here to do background processing
//
//
NSLog(@"Thread Excecution started");
NSError* configureError;
[[GGLContext sharedInstance] configureWithError: &configureError];
NSAssert(!configureError, @"Error configuring Google services: %@", configureError);
[GIDSignIn sharedInstance].delegate = self;
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
dispatch_async(dispatch_get_main_queue(), ^{
// Add code here to update the UI/send notifications based on the
// results of the background processing
NSLog(@"Thread Excecution completed");
});
});
return YES;
}
通知が実際に発生し、メインスレッドの権限でも受信される場合は保証されません。あなたはそれをしたいと思いますか? – NSNoob
なぜ、バックグラウンドスレッドに外部APIの起動コードを書き込む必要があるのですか? – NSNoob
これらのコードをViewdidloadに追加することはできますか?それはうまくいくでしょうか? – Saranjith