Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LRFilterBar and Bindings



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.