ksnowlv

回顾过去,总结以往;立足现在,铭记当下;技术为主,笔记而已.

NSInvocationOperation的使用

| Comments

NSInvocationOperation的一个子类,在对NSOperation控制要求不高的情况下,可以使用。

例如:

1
2
3
4
5
6
7
8
9
10
NSInvocationOperation* op = [[NSInvocationOperation alloc]
                                   initWithTarget:self selector:@selector(doLongTimeTask) object:nil];


[myQueue addOperation:op];
[op release];

- (void)doLongTimeTask {
    //可以使用performSelectorOnMainThread来将得来的数据返回到主线程
}

Comments

comments powered by Disqus
Included file 'custom/after_footer.html' not found in _includes directory