• 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: LRFilterBar and Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LRFilterBar and Bindings


  • Subject: Re: LRFilterBar and Bindings
  • From: Keith Duncan <email@hidden>
  • Date: Mon, 30 Jul 2007 14:00:02 +0100

Firstly I don't know if LRFilterBar is bindings capable, but if it is then you can *fake* an array using indexed accessors. There is an example of this in mmalc's Combatants sample code: http://homepage.mac.com/mmalc/CocoaExamples/controllers.html

Here the filter bar would be bound to the key produce -

- (unsigned int)countOfProduce {
	return ([_produce count] + 4);
}

- (id)objectInProduceAtIndex:(unsigned int)index {
	switch (index) {
		case 0:
			return NSLocalizedString(@"All Produce", @"");
		case 1:
			return NSLocalizedString(@"Fruits", @"");
		case 2:
			return NSLocalizedString(@"Vegetables", @"");
		case 3:
			return @"DIVIDER";
		default:
			return [_produce objectAtIndex:(index - 4)];
	}
}

Typed in mail, usual warnings apply.

- Keith
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >LRFilterBar and Bindings (From: Michael Fey <email@hidden>)
 >Re: LRFilterBar and Bindings (From: "I. Savant" <email@hidden>)
 >Re: LRFilterBar and Bindings (From: Michael Fey <email@hidden>)

  • Prev by Date: Re: LRFilterBar and Bindings
  • Next by Date: Re: Changing the app language
  • Previous by thread: Re: LRFilterBar and Bindings
  • Next by thread: Is there an API which allow to manipulate Safari Bookmarks?
  • Index(es):
    • Date
    • Thread