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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to