RE: Tons of fun w/NSComboBox
RE: Tons of fun w/NSComboBox
- Subject: RE: Tons of fun w/NSComboBox
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Thu, 14 Aug 2003 12:11:14 -0400
You're combo boxes disappear because you've set their cell to nil. You need
to create an instance of your cell, not merely declare a variable for it.
You say:
>
>
And then in my Document.h file declare:
>
>
>
BetterComboBoxCell *myComboBoxCell;
That's fine, although probably unnecessary.
>
>
>
Then in my Document.m file declare:
>
>
- (void)awakeFromNib
>
{
>
...
>
[myComboBox setCell:myComboBoxCell];
>
...
>
}
I would do it this way:
- (void)awakeFromNib
{
...
[myComboBox setCell:[[[BetterComboBoxCell alloc] init] autorelease]];
...
}
I'm assuming that you don't really need variable that refers to the cell;
you just need some way of sticking the cell in your combo box. The combo
box will retain its cell, so you can autorelease it when it is created.
Jonathan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.