• 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: Don Arbow <email@hidden>
  • Date: Thu, 14 Aug 2003 10:35:40 -0700

On Wednesday, August 13, 2003, at 12:52 PM, Jonathan E. Jackel wrote:

>> If I override (NSString *)completedString:(NSString *)substring, does
>> it
>> apply to every NSComboBox on my app, or does it apply only to a
>> particular
>> NSComboBox?
>
> The latter. You should subclass NSComboBoxCell and write your own
> implementation of completedString. In awakeFromNib, you should set
> the cell
> of the combo cox to be an instance of your subclass. Your
> implementation
> will work only for instances of your subclass, so it will only work for
> combo boxes where you have explicitly set the cell to be your cell.
>



In Cocoa, you very rarely need to subclass objects in the AppKit.
According to the documentation for completedString: in NSComboBoxCell,
you can do it this way:

The default implementation of this method first checks whether the
combo box uses a data source and whether the data source responds to
comboBox:completedString: or comboBoxCell:completedString:

Also take a look at the documentation for NSComboBoxDataSource, this
explains the use of the completedString: method used by the data source.

Don
_______________________________________________
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: "Jonathan E. Jackel" <email@hidden>)

  • Prev by Date: NSPanel nib with NSWindowController
  • Next by Date: Re: 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