• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: performSelectorOnMainThread primitives for withObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: performSelectorOnMainThread primitives for withObject


  • Subject: RE: performSelectorOnMainThread primitives for withObject
  • From: Kirk Kerekes <email@hidden>
  • Date: Wed, 22 Apr 2009 11:49:33 -0500

You don't have to use NSInvocation -- you could instead define a category on NSView that wrapped setActivated:

(**** STANDARD COMPOSED IN MAIL WARNING ****)

- (void) setActivatedWithObjectValue: (id) value
{
[self setActivated: [value boolValue]];
}

OR

- (void) setActivatedWithObjectValue: (id) value
{
[self setValue: value forKey: @"activated"];
}

OR, in your thread:

[view performSelectorOnMainThread: @selector(setValuesForKeysWithDictionary:) withObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], @"activated",nil] waitUntilDone: YES];


Hey folks,

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.

Do I really have to use NSInvocation for this?

cheers
--
Torsten
_______________________________________________

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


  • Prev by Date: Re: performSelectorOnMainThread primitives for withObject
  • Next by Date: Re: iphone SDK session duration
  • Previous by thread: Re: performSelectorOnMainThread primitives for withObject
  • Next by thread: NSApplication, AppleEvent and CFRunLoop source strange interaction
  • Index(es):
    • Date
    • Thread