• 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: Newbie #import confusion...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie #import confusion...


  • Subject: Re: Newbie #import confusion...
  • From: Matt Reagan <email@hidden>
  • Date: Wed, 28 Dec 2005 04:23:00 -0800

thank you!

On 12/28/05, email@hidden <email@hidden> wrote:
> Hi,
> If you just need that compiler knows your custom class, just replace
> #import "myheader.h"
> to
> @class myclass
>
> However, if your class needs to know some method or other things of the other
> class, you have to import and to avoid "circular import", I think (but not
> sure) you have to use #ifndef....#endif
>
> Maybe another solution....
> Regards,
> Guillaume
>
> Selon Matt Reagan <email@hidden>:
>
> > Can anyone please help me out? The answer to this is so amazingly
> > simple that I can't seem to find it anywhere...
> >
> > I have a controller object with an outlet pointing to a NSView
> > subclass, and that NSView has an outlet pointing back to the
> > controller. My problem is that because the IBOutlet declartions are
> > typed to these specific classes, I have to #import each header so the
> > compiler can see what it needs to compile, but I'm getting some kind
> > of circular problem where the NSView's source imports the controller's
> > header, which in turn imports the view's header, and round and round
> > it goes. So I get a compile error. In the NSView's source code,
> > changing this declaration:
> >
> > IBOutlet myCustomView *theView;
> >
> > to this:
> >
> > IBOutlet id *theView;
> >
> > will allow it to compile, but obviously there must be some way to
> > avoid this problem without having to get rid of the class typing.
> >
> > Can someone shove my nose into the obvious solution for this?
> >
> > Thank you all for your help,
> > -matt
> > _______________________________________________
> > 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
> >
>
>
>
_______________________________________________
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

References: 
 >Newbie #import confusion... (From: Matt Reagan <email@hidden>)
 >Re: Newbie #import confusion... (From: email@hidden)

  • Prev by Date: Tracking an NSArrayController's selection
  • Next by Date: How to get where cluase of the query with actual parameters(instead of bind variables) from cocoa client?
  • Previous by thread: Re: Newbie #import confusion...
  • Next by thread: NSPropertyListSerialization/plutil bloat in Tiger vs Jaguar
  • Index(es):
    • Date
    • Thread