Re: Cocoa Headers Inconsistent With Online Docs
Re: Cocoa Headers Inconsistent With Online Docs
- Subject: Re: Cocoa Headers Inconsistent With Online Docs
- From: Timothy Carl Buchheim <email@hidden>
- Date: Wed, 11 Feb 2004 16:20:00 -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...
It's defined in NSThread.h, as a category on NSObject. (This makes
sense, in a way.)
Here's a copy of the actual definition, found at the end of 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
waitUntilD
one:(BOOL)wait modes:(NSArray *)array;
- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg
waitUntilD
one:(BOOL)wait;
// equivalent to the first method with kCFRunLoopCommonModes
@end
#endif
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.)
well, you need to include the NSThread.h header file. If you're using
#import <Foundation/Foundation.h> or or #import <Cocoa/Cocoa.h> then
this ought to be happening automatically.
--
Tim Buchheim System Administrator
Computer Science Department Phone: (909) 607-3485
Harvey Mudd College Fax: (909) 607-8364
1250 N Dartmouth Ave E-mail: email@hidden
Claremont, CA 91711
http://www.cs.hmc.edu/~tcb/
_______________________________________________
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.