• 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: NSCombobox subclass and binding ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCombobox subclass and binding ?


  • Subject: Re: NSCombobox subclass and binding ?
  • From: Scott Anguish <email@hidden>
  • Date: Sat, 9 Jul 2005 00:22:46 -0400


On Jul 8, 2005, at 11:41 PM, Ricky Sharp wrote:


On Jul 8, 2005, at 5:15 PM, Robert Miller wrote:


I hope someone can help. I have a subclass of NSCombobox that displays a custom resizable popup list instead of the standard fixed size list. The subclass list populates fine when using an internal list defined in a nib for the custom combo box class by simply making the subclass box the data source of my table I can do this:

- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
        return [self numberOfItems];
}

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int) rowIndex
{
return [self itemObjectValueAtIndex:rowIndex];
}



However, when bindings are attached to the subclass the list does not populate. The question is how can I take advantage of NSCombobox'es default binding and obtain the data from that binding to populate the custom popup list ? Any help would be greatly appreciated.



I don't think that is possible to do. When originally doing a custom radio group (NSMatrix containing subclasses of NSActionCell), I couldn't use the selectedTag or selectedIndex bindings to get both model-initiated and view-initiated changes handled. I remedied the problem by subclassing NSMatrix (IIRadioGroup) and adding my own custom binding (selectedRadioTag).


Thus, look into adding a custom binding to your NSCombobox subclass.



you want be able to get information from the bindings that are handled by the superclass? If you're on Tiger, send the combobox - infoForBinding: with a binding name... if you want to run on pre Tiger, it's ugly, You need to override the bind:... method and sock away the info you want to keep and then pass it along to the superclass implementation



_______________________________________________
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


  • Follow-Ups:
    • Re: NSCombobox subclass and binding ?
      • From: Robert Miller <email@hidden>
    • Re: NSCombobox subclass and binding ?
      • From: Robert Miller <email@hidden>
References: 
 >NSCombobox subclass and binding ? (From: Robert Miller <email@hidden>)
 >Re: NSCombobox subclass and binding ? (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Determining if NSArray/NSDictionary is immutable
  • Next by Date: Re: Coredata Applications and accessing Managed Objects
  • Previous by thread: Re: NSCombobox subclass and binding ?
  • Next by thread: Re: NSCombobox subclass and binding ?
  • Index(es):
    • Date
    • Thread