0

I have written code in my project

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

in Method

- (void)loadImage {

}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sami
  • 139
  • 2
  • 8
  • If you want to get passed object i.e 'ob' in your case, your method 'loadImage' should accept argument like - (void)loadImage:(id) object. – kkumpavat Jun 08 '14 at 08:28

1 Answers1

1

This might help;

// 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
}

For further refence / information about NSInvocationOperation: NSInvocationOperation Class Reference

tomalbrc
  • 171
  • 2
  • 16