在跟FB Graph API要资料时
xcode提醒我,这行为占用main thread太久的时间
所以我把这段程式码丢到dispatch_async中执行
但却完全没反应
请问有得解吗?
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,
0), ^{
[FBRequestConnection startWithGraphPath:@"/me/taggable_friends"
parameters:nil
HTTPMethod:@"GET"
completionHandler:^(
FBRequestConnection
*connection,
id result,
NSError *error
) {
/* handle the result */
NSLog(@"%@",result);
[self insertFriendInfoToContainer:[result
objectForKey:@"data"]];
}];
});
不管如何,都无法执行到nslog那行