I have two objects one is NSData and another one is NSString. I want to send this two objects with perfomSelectorOnMainThread
. How I can do this?
If you are using XCode 4.4 and later you can simply do:
[self performSelectorOnMainThread:@selector(myMethod:) withObject:@[objectA,objectB] waitUntilDone:NO];
If you have XCode version older then 4.4 use
[self performSelectorOnMainThread:@selector(myMethod:) withObject:[NSArray arrayWithObjects:objectA, objectB, nil] waitUntilDone:NO];
This is your selector methods:
-(void)myMethod:(NSArray*)array{
ObjectA *objA = [array objectAtIndex:0];
ObjectB *objB = [array objectAtIndex:1];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With