Re: 'Class' may not respond to +isKindOfClass
Re: 'Class' may not respond to +isKindOfClass
- Subject: Re: 'Class' may not respond to +isKindOfClass
- From: "Louis C. Sacha" <email@hidden>
- Date: Thu, 15 Apr 2004 03:20:08 -0700
Hello...
Class objects can respond to instance methods defined in NSObject, so
it could respond to the message even though there isn't a
isKindOfClass class method. The compiler is just pointing out that
there is no such class method (which is the main reason you weren't
able to find a +isKindOfClass method).
The warning may have gone away temporarily (since the project is
using the already compiled version of that file), but as soon as you
change something that causes the file to be recompiled it will
probably be back. In general, files that only have warnings aren't
recompiled unless you make a change to them, so the warning isn't
shown again until then.
Instead of using isKindOfClass: for the check, it would probably be
more appropriate to use the class method +isSubclassOfClass: when you
know you are dealing with a class.
Hope that helps,
Louis
Can anyone tell me why the following would generate the subject warning?
[paneClass isKindOfClass:[NSObject class]
In this case, paneClass comes either from NSClassFromString() or a
bundle's principal class. I can't find a "+isKindOfClass:" anywhere.
I can find "-isKindOfClass:", though. Also odd is that if I close the
project after receiving the warning, reopen it and then build, the
warning no longer appears.
Larry Fransson
Seattle, WA
_______________________________________________
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.