Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
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