• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error using categories: 'cannot find interface section for MyClass'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error using categories: 'cannot find interface section for MyClass'


  • Subject: Re: Error using categories: 'cannot find interface section for MyClass'
  • From: Jon Hull <email@hidden>
  • Date: Wed, 21 Feb 2007 11:53:51 -0800

Well, since you control both classes, you could always put both sections into one set of .h and .m files. That is probably the simplest method. Alternatively, if you need separate files, you might be able to #import <MyClassExtension.h> in MyClass.m, but I think you might need the @class directive to avoid a recursive include.

Thanks,
Jon


On Feb 21, 2007, at 11:37 AM, 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>
@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:
This email sent to 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


  • Follow-Ups:
    • Re: Error using categories: 'cannot find interface section for MyClass'
      • From: Uli Kusterer <email@hidden>
References: 
 >Error using categories: 'cannot find interface section for MyClass' (From: "Arthur C." <email@hidden>)

  • Prev by Date: ObjC runtime and the loader
  • Next by Date: Re: orderBack: only works when frontmost?
  • Previous by thread: Re: Error using categories: 'cannot find interface section for MyClass'
  • Next by thread: Re: Error using categories: 'cannot find interface section for MyClass'
  • Index(es):
    • Date
    • Thread