performSelector:withObject:afterDelay: not making call

前端 未结 4 1971
情书的邮戳
情书的邮戳 2021-02-19 00:45

in a method, i want to call a method after n seconds:

    self.toolBarState = [NSNumber numberWithInt:1];
    [self changeButtonNames];
    [self drawMap];
    [         


        
4条回答
  •  孤街浪徒
    2021-02-19 01:36

    I got the same problem when I call performSelector:withObject:afterDelay: in a background thread created by ReactiveCocoa. If I execute the block in the ReactiveCocoa's way, the block will be called correctly:

     [[[RACSignal empty] delay:2.0] subscribeCompleted:^(){
        // do something
     }];
    

    I guess there is some magic in the ReactiveCocoa's threading model.

提交回复
热议问题