I want to transfer an Object pointer as a parameter to me selector, however, it will not allow me to do that, is there anyway to do that? or is there any workaround here?
I have two Classes, A Class will do something and then the result feed back to B class.
what I am doing now in A instance:
MyObject *b;
[b addTarget:self withSelector:@selector(dosomething:) ];
-(void)dosomething:(NSString **)string
{
*string="some thing is implemented";
}
B instance:
{
NSString *mystring;
[a performSelector:dosomething withObject:&mystring];
}
Thanks.
You can only pass a valid Objective-C object to
-performSelector:withObject:.You have three options.
Pass a mutable string:
Return a string:
Pass an NSValue that contains a NSString**: