Re: Error using categories: 'cannot find interface section for MyClass'
Re: Error using categories: 'cannot find interface section for MyClass'
- Subject: Re: Error using categories: 'cannot find interface section for MyClass'
- From: Tommy Nordgren <email@hidden>
- Date: Thu, 22 Feb 2007 12:06:43 +0100
On 21 feb 2007, at 20.37, Arthur C. wrote:
I'm trying to use categories to separate two sections of one class.
The code looks as follows:
[ MyClassExtension.h ]
#import <MyClass.h>
This is plain wrong:
Your own headers should be included with:
#import "MyClass.h"
Angle brackets are for standard headers only.
@interface MyClass (MyClassExtension)
- (void) extraMethod;
...
@end
[ MyClassExtension.m ]
#import "MyClassExtension.h"
@implementation MyClass (MyClassExtension)
- (void) extraMethod
{
...
}
@end
Now, do I have to include
#import "MyClassExtension.h"
in the file MyClass.h ? If I do so, I get the error 'cannot find
interface section for MyClass'
If I don't, I get the compiler warning 'MyClass may not respond to
extraMethod' if I try to call it from MyClass.
So, what is the solution for this?
Thanks for your time,
Arthur C.
_________________________________________________________________
Talk with your online friends with Messenger http://
www.join.msn.com/messenger/overview
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
40comhem.se
This email sent to email@hidden
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden