• 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: mmalcolm crawford <email@hidden>
  • Date: Wed, 28 Dec 2005 02:42:38 -0800


On Dec 28, 2005, at 2:27 AM, Matt Reagan wrote:

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:

Use the @class directive:
<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ LanguageOverview/chapter_4_section_5.html>

IBOutlet id *theView;

Note that this is not what you intend. This is a pointer to an object, not an object -- think of it as an untyped
NSObject **theView. You would just use,

IBOutlet id theView;

except that Interface Builder treats all id's as outlets anyway, so you would only need:
id theView;

mmalc

_______________________________________________
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>)

  • Prev by Date: Re: Newbie #import confusion...
  • Next by Date: Re: Newbie #import confusion...
  • Previous by thread: Re: Newbie #import confusion...
  • Next by thread: Re: Newbie #import confusion...
  • Index(es):
    • Date
    • Thread