-1
在我的ios应用程序中,我已经包括谷歌,脸谱和推特整合。当应用程序启动时,它在加载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