How to get warned about missing method implementations for selectors defined in category interfaces
How to get warned about missing method implementations for selectors defined in category interfaces
- Subject: How to get warned about missing method implementations for selectors defined in category interfaces
- From: leenoori <email@hidden>
- Date: Wed, 15 Nov 2006 12:01:09 +0100
Is there any way to get GCC to warn me if I do something silly like
#import a category header file but forget to compile the category
implementation?
* If you forget to include a class header you get "undeclared" error
at compile time
* If you forget to include a class implementation you get an
undefined symbol error at link time
* If you forget to include a category header you get unknown selector
warnings ("X may not respond to Y") at compile time
* If you forget to include a category implementation you get no
warnings, and fail at runtime
Basically, the first three mistakes can be caught at build time, and
I'd like to catch that last one at runtime too. It's a mistake I
don't make very often, but I am working on a number of projects which
share some common files (hundreds of source files in all) and I do
occasionally add a category header and overlook the implementation.
It would be nice to catch this at build time rather than runtime.
I can't find a switch in the GCC manpage that would turn on this kind
of warning. Any ideas for how I could achieve this? The only thing
that I can think of so far is to declare an external symbol in the
category header and then make some kind of reference to it, thus
trigger a linker error, but it is a bit kludgy. Any ideas for a more
elegant solution?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden