[問題] dispatch_async callback not work
在跟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那行
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.248.186.235
※ 文章網址: http://www.ptt.cc/bbs/MacDev/M.1411460461.A.35D.html
推
09/24 09:00, , 1F
09/24 09:00, 1F
推
09/30 23:42, , 2F
09/30 23:42, 2F
→
09/30 23:42, , 3F
09/30 23:42, 3F
→
09/30 23:43, , 4F
09/30 23:43, 4F
推
09/30 23:48, , 5F
09/30 23:48, 5F
→
09/30 23:49, , 6F
09/30 23:49, 6F
→
09/30 23:50, , 7F
09/30 23:50, 7F
→
09/30 23:51, , 8F
09/30 23:51, 8F
→
09/30 23:59, , 9F
09/30 23:59, 9F
→
10/01 00:00, , 10F
10/01 00:00, 10F
→
10/01 00:00, , 11F
10/01 00:00, 11F
→
10/01 00:01, , 12F
10/01 00:01, 12F