NSOperation on the iPhone

前端 未结 7 642
攒了一身酷
攒了一身酷 2020-11-28 19:54

I\'ve been looking for some concrete scenarios for when NSOperation on the iPhone is an ideal tool to use in an application. To my understanding, this is a wrap

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 20:16

    Here is just a very simple implementation but take time to read the tutorials to fully understand everything:

    NSOperationQueue *queue = [NSOperationQueue new];
    
    NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self
        selector:@selector(methodToCall)
        object:objectToPassToMethod];
    
    [queue addOperation:operation];
    

提交回复
热议问题