Re: Cocoa Headers Inconsistent With Online Docs
Re: Cocoa Headers Inconsistent With Online Docs
- Subject: Re: Cocoa Headers Inconsistent With Online Docs
- From: Shawn Erickson <email@hidden>
- Date: Wed, 11 Feb 2004 15:46:59 -0800
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.