我正在开发一个 iPhone 应用程序,我试图在一定延迟后调用特定的方法。但是该方法没有被调用。我不知道为什么它没有被调用。
这是我的代码
-(void)gettingCommentsList { // some stuff....
[self performSelector:@selector(callGetListInBackgroundMethod) withObject:nil afterDelay:1.0]; }
-(void)callGetListInBackgroundMethod {
isFromthread =YES;
NSLog(@"callGetListInBackground");
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Add code here to do background processing
//
//
[self gettingCommentsList];
dispatch_async( dispatch_get_main_queue(), ^{
// Add code here to update the UI/send notifications based on the
// results of the background processing
[self.commentsTbl reloadData];
});
});
}
谢谢