2017-06-02 103 views
0

此代码的工作,并postSpamListUpdatedNotification被称为performSelector被称为但不performSelector:afterDelay

- (void) postSpamListUpdatedNotification 
{ 
    [NIDPrivateUtils postNotification:kNIDSpamListsUpdated andError:nil]; 
} 

[self performSelector:@selector(postSpamListUpdatedNotification) withObject:nil]; 

但如果我把它改成这样,那么postSpamListUpdateNotification不会被调用。为什么?

[self performSelector:@selector(postSpamListUpdatedNotification) withObject:nil afterDelay:2.0]; 

回答

1

您可能没有此线程的runloop。 performSelector:withObject:afterDelay:需要一个runloop,但performSelector:不需要。