Re: Compiler Warning City
Re: Compiler Warning City
- Subject: Re: Compiler Warning City
- From: matt neuburg <email@hidden>
- Date: Mon, 28 Oct 2002 12:22:05 -0800
On Sat, 26 Oct 2002 11:53:30 -0500, Kirk Kerekes <email@hidden> said:
>
I just tested the following kluge-around code, and it works.
>
>
@interface NSObject (IdMethods)
>
- (void) _setAvoidsActivation:(BOOL) value;
>
@end
>
>
lets me call:
>
>
{
>
id test = [self window];
>
[test _setAvoidsActivation:YES];
>
}
>
>
-- with no compiler warnings at all. Use of any other non-NSObject
>
method on id still generates the appropriate warning.
>
Note that this doesn't actually create a category on NSObject -- it
>
just goofs the compiler into assuming that the category exists at
>
compile time
I agree with all of this, and this is something I often do myself, except that I don't think of it as a kluge-around, and I don't see it as "goofing the compiler". I think it's a good solution, and I think you *are* creating a category. m.
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.