Re: Question about matrix of possibilities
Re: Question about matrix of possibilities
- Subject: Re: Question about matrix of possibilities
- From: Uli Kusterer <email@hidden>
- Date: Wed, 16 Oct 2013 20:51:21 +0200
On 16 Oct 2013, at 18:48, Eric E. Dolecki <email@hidden> wrote:
> I've been asked to make a tableview with 8 rows. Each row has a UISwitch.
> Based on a combination of switch values, the result would be a different
> image displayed to the right of the table (this is for iPad).
>
> How would I best go about covering all of those combinations?
>
> When one switch changes I'll check it's on/off state and then run some
> evaluation method based on the values for all of the switches. How do I do
> that without getting too ugly about it?
I'd just name the image after the activated switch states (or even switch names). E.g. if the rows are
Red
Yellow
Blue
I'd name a purple image RedBlue.png. If it's more complicated than at most 8 switches, I might go with a bit-field approach like Marco suggests.
(Of course, for colors I'd just write code to mix colors and do away with the images, bad example, but you get the gist).
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
_______________________________________________
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