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: "Shawn Erickson" <email@hidden>
- Date: Wed, 21 Feb 2007 11:44:12 -0800
On 2/21/07, Arthur C. <email@hidden> wrote:
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.
Consider something like the following...
[ MyClass.h ]
#import "MyClassExtension.h"
...
[ MyClassExtension.h ]
@class MyClass;
@interface MyClass (MyClassExtension)
- (void) extraMethod;
...
@end
[ MyClassExtension.m ]
#import "MyClass.h"
#import "MyClassExtension.h"
@implementation MyClass (MyClassExtension)
- (void) extraMethod
{
...
}
@end
[ OtherCode.m ]
#import "MyClass.h"
...
[instanceOfMyClass extraMethod];
...
-Shawn
_______________________________________________
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