Re: Categories Generating Warnings?
Re: Categories Generating Warnings?
- Subject: Re: Categories Generating Warnings?
- From: Jason Jobe <email@hidden>
- Date: Fri, 11 Feb 2005 18:17:59 -0500
I'm imagining that you haven't included the header file(s) for the categories (directly or indirectly) in the complaining file.
I would import the category header(s) in the main header or create a consolidating one for general use.
On Feb 11, 2005, at 5:45 PM, David Olbersen wrote:
Hello all!
I'm trying to break out a class into several files to make development easier. To do this I'd like to use categories. Here's what I'm doing:
- Create base class (TWRobot) with an interface (TWRobot.h) and implementation file (TWRobot.m)
- Create category files based on functional chunks of code. For example TWRobot+Drawing.{h,m} to handle the code for drawing a TWRobot.
TWRobot+Drawing.h does the right thing, AFAIK:
#import "TWRobot.h"
@interface TWRobot (Drawing)
- (void) drawMyselfAsTriangle;
- (void) drawMyselfAsRobot;
- (void) drawCollisionField;
@end
TWRobot+Drawing.m does the right thing too, AFAIK:
#import "TWRobot+Drawing.h"
@implementation TWRobot (Drawing)
... various method implementations
@end
Now that those methods are defined (TWRobot+Drawing.h) and implemented (TWRobot+Drawing.m) I'd like to use them in the core class (TWRobot.m). This works, I just get a lot of compiler warnings.
All the warnings are in the form:
`TWRobot' may not respond to `<method defined in TWRobot+Drawing.h>'
cannot find method `<method defined in TWRobot+Drawing.h>'; return type of `id' assumed
So like I said, everything works: when I call the methods they're executed as they should be, I've just got these ugly warnings all over the place. Am I doing something wrong or will I just have to live with it?
--
David Olbersen _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
- jason
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden