0

我在我的项目中编写了代码

[NSInvocationOperation alloc]
                                        initWithTarget:self
                                        selector:@selector(loadImage)
                                        object:ob

在方法

- (void)loadImage {

}
4

1 回答 1

1

这可能会有所帮助;

// Your NSInvocationOperation definition 
[NSInvocationOperation alloc] initWithTarget:self selector:@selector(loadImage:) object:ob]; 

// Add an argument, this one is called 'sender'
- (void)loadImage:(id)sender { // 'sender' equals your object 'ob' from above
    // Do whatever you want to
}

有关 NSInvocationOperation 的进一步参考/信息: NSInvocationOperation 类参考

于 2014-06-08T14:28:03.987 回答