Re: performSelectorOnMainThread primitives for withObject
Re: performSelectorOnMainThread primitives for withObject
- Subject: Re: performSelectorOnMainThread primitives for withObject
- From: Ken Thomases <email@hidden>
- Date: Wed, 22 Apr 2009 11:25:39 -0500
On Apr 22, 2009, at 11:13 AM, Torsten Curdt wrote:
Is this supposed to work or not?
- (void) setActivated:(BOOL)theStatus;
[view performSelectorOnMainThread:@selector(setActivated:)
withObject:[NSNumber numberWithBool:YES] waitUntilDone:YES];
It does not seem like it works that way.
No, that doesn't work. It does not convert between NSNumber and BOOL
for you.
Do I really have to use NSInvocation for this?
If the setActivated: method is one of your own, you can change it to
take an NSNumber.
Alternatively, you can create a small wrapper method especially for
use with -performSelector... like so:
- (void) setActivatedWithNumber:(NSNumber*)theNumber
{
[self setActivated:[theNumber boolValue]];
}
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden