• 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: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView


  • Subject: Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
  • From: Peter Zegelin <email@hidden>
  • Date: Fri, 26 Jun 2009 14:27:21 +1000


On 26/06/2009, at 1:24 PM, Quincey Morris wrote:

After all, the non-band-aid way is almost as easy:

- (id) initWithNibName: (NSString*) nibNameOrNil bundle: (NSBundle*) nibBundleOrNil {
self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil];
if (!self)
return nil;
numColumns = 8;
return self;
}

(I'm assuming that the view controller is not itself if a nib file. If it is, you need to used initWithCoder instead.)


This is definitely the right answer this time. If it isn't the wrong answer.

Heh :-)

Ok - I've implemented initWithNibName and set the value there. Works great - thanks!

As an aside, this caused another little problem because I then immediately called my method to show and hide columns, but at that point there was no ref to the tableview. I ended up also having:

- (void)awakeFromNib{
[self setColumnHidden]; <- tried this in initWithNibName but it was too early
}


which fixes that as well.

thanks everyone,

Peter
_______________________________________________

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


References: 
 >NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Peter Zegelin <email@hidden>)
 >Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Keary Suska <email@hidden>)
 >Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Peter Zegelin <email@hidden>)
 >Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Quincey Morris <email@hidden>)
 >Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Peter Zegelin <email@hidden>)
 >Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: GC pros and cons
  • Next by Date: Re: Ideas required on testing an application install
  • Previous by thread: Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
  • Next by thread: Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
  • Index(es):
    • Date
    • Thread