NSBrowser, bindings, and a custom cell class

Apple, Cocoa, General

Hi Cocoa Programmers,

There is a small bug in NSBrowser if you use bindings and want a custom cell class. Typically, you would do something like this in your awakeFromNib:

- (void)awakeFromNib {
    [iBrowser setCellClass:[ImageTextBrowserCell class]];
}

However, if you are using bindings, it won’t work. The cells that were archived out in the nib file will not have the proper class. So, you have to nudge NSBrowser a bit to get it going:

- (void)awakeFromNib {
    [iBrowser setCellClass:[ImageTextBrowserCell class]];
    [iBrowser loadColumnZero];
}

Just a quick tip in case you run into this!



Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Subscribe to new posts:

You'll get an email whenever a I publish a new post to my blog and nothing more. -- Corbin

As an Amazon Associate I earn from qualifying purchases.

(c) 2008-2024 Corbin Dunn

Privacy Policy

Subscribe to RSS feeds for entries.

64 queries. 0.153 seconds.

Log in