• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Tons of fun w/NSComboBox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Tons of fun w/NSComboBox (From: Mike Brinkman <email@hidden>)

  • Prev by Date: Coding question
  • Next by Date: Re[2]: Control Over IB 'Visible At Launch Time' Flag
  • Previous by thread: Re: Tons of fun w/NSComboBox
  • Next by thread: Re: Tons of fun w/NSComboBox
  • Index(es):
    • Date
    • Thread