• 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: NSTableView questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView questions


  • Subject: Re: NSTableView questions
  • From: Hrishikesh Muruk <email@hidden>
  • Date: Sun, 7 Oct 2007 22:54:01 +0530

I added a public member to my dataSrc class (edited the .h file)

IBOutlet NSTablView *myTable;

But I don't see that outlet when I open the .nib file.

Is adding the outlet using Interface builder the only option? Then I would have to re-instantiate the c\object, redo all connections, and generate source files again. Is there an easier way?
Thanks
Hrishi


On 06-Oct-07, at 6:00 PM, Uli Kusterer wrote:

Am 05.10.2007 um 18:58 schrieb Chris Williams:
- You get a reference to the NSTableView by declaring a variable as such:

    (IBOutlet) NSTableView *myTable;

and connecting it in the Interface Builder. It isn't unreasonable to
declare this as an Extern even, and reference it from several code modules.

Are you sure this will compile? I never heard about being able to use "extern" with an outlet, and the brackets shouldn't work either. IBOutlet is only a marker that you put next to *instance* variables of objects (i.e. instances), so that when you drag the header onto one of Interface Builder's NIB windows to have it parsed, it'll know that this instance variable is supposed to be an outlet and that you want to be able to hook up another object in the NIB to it.


So yes, IBOutlet is what Hrishikesh will want to use here. But extern and regular variables don't enter the picture here. ALso, an extern isn't really a good design anyway. Use an accessor method on the object here.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de




--- www.greenwaysroad.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: NSTableView questions
      • From: Daniel Staal <email@hidden>
    • Re: NSTableView questions
      • From: Chris Williams <email@hidden>
References: 
 >Re: NSTableView questions (From: Chris Williams <email@hidden>)
 >Re: NSTableView questions (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: What is contentObject used for?
  • Next by Date: Re: What is Object Class Name used for in bindings?
  • Previous by thread: Re: NSTableView questions
  • Next by thread: Re: NSTableView questions
  • Index(es):
    • Date
    • Thread