Compiler gives warning on performSelectorOnMainThread:@selector(delegateMethod)

后端 未结 4 2100
渐次进展
渐次进展 2021-01-05 02:29

I have an NSOperation that wraps some web service functionality. The NSOperation has a delegate that is to be messaged when the operation is over.

As the NSOperation

4条回答
  •  死守一世寂寞
    2021-01-05 02:31

    Actually on iOS 4 I prefer using NSNotifications and Observers (with Blocks) to perform updates on the mainthread.

    - (id)addObserverForName:(NSString *)name object:(id)obj queue:(NSOperationQueue *)queue usingBlock:(void (^)(NSNotification *))block
    

    I wrote down my design here.

提交回复
热议问题