• 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: Cocoa Headers Inconsistent With Online Docs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Headers Inconsistent With Online Docs


  • Subject: Re: Cocoa Headers Inconsistent With Online Docs
  • From: Daniel Todd Currie <email@hidden>
  • Date: Wed, 11 Feb 2004 16:03:20 -0800

Ah, duh... I was trying to build the project for 10.1, and assumed that the oddities surrounding the documentation were a symptom of my problem. Thanks for your insight, everyone who responded.

// Daniel


On 2004 Feb 11, at 15:46, Shawn Erickson wrote:


On Feb 11, 2004, at 2:40 PM, Daniel Todd Currie wrote:

The online cocoa documentation lists this method in NSObject:

- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)wait

However, the NSObject.h file in /System/Library/Frameworks does not list this method. I assume this is why I'm getting a compiler warning on my app regarding my usage of -performSelectorOnMainThread:. The app works just fine though...

So where is this method actually declared? Why is there this inconsistency? What can I do about this compiler warning? (I really hate having compiler warnings.)

No inconsistency exist, it is common for methods to be added to classes via categories. Also you didn't list what compiler warning you are seeing so we cannot help you with it...

Anyway, it is an NSThread addition on NSObject. In Xcode you can command double click on a symbol to get the header that defines it to pop up, in this case NSThread.

From NSThread.h...

#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED
@interface NSObject (NSMainThreadPerformAdditions)

- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)wait modes:(NSArray *)array;
- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)wait;
// equivalent to the first method with kCFRunLoopCommonModes

@end
#endif

Note as documented it is only available on 10.2 and later.

-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Cocoa Headers Inconsistent With Online Docs (From: Daniel Todd Currie <email@hidden>)
 >Re: Cocoa Headers Inconsistent With Online Docs (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: Simple example of threading
  • Next by Date: Re: Cocoa Headers Inconsistent With Online Docs
  • Previous by thread: Re: Cocoa Headers Inconsistent With Online Docs
  • Next by thread: Re: Cocoa Headers Inconsistent With Online Docs
  • Index(es):
    • Date
    • Thread