Help with custom NSCell and Bindings in Table View
Help with custom NSCell and Bindings in Table View
- Subject: Help with custom NSCell and Bindings in Table View
- From: Mike Abdullah <email@hidden>
- Date: Sun, 5 Mar 2006 00:43:46 +0000
I've subclassed NSCell in my app so that it effectively "contains"
several other NSCells - NSPopupButtonCell and NSTextFieldCell in
particular.
Now, I've got the whole to display nicely with my NSArrayController.
However, I have one pretty major problem!
I have subclassed the NSTableView so that when awakeFromNib is
called, the data cell of the first column is set to be:
[[MyCustomCell alloc] initCustomCell]
As I say, this causes the thing to draw properly. However, by using
ObjectAlloc, I can see that MyCustomCell is only ever instanciated
once. This means that all the cells in my TableView are "the same."
So I change the value of the popup button in one cell, and when
another cell needs to redraw itself, then its popupcell changes to
match the new value!
So, what am I doing wrong to cause this behaviour? How do I get
NSArrayController to properly set up and manage a seperate instance
of MyCustomCell for each row of the table?
Also, what I want to then do is bind the values of each of the cells
in MyCustomCell to their own keys in the central NSArrayController.
I imagine this is a little trickier to do though!
Any help, very, very much appreciated :)
Mike.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden