Re: One IBAction, multiple results from multiple methods
Re: One IBAction, multiple results from multiple methods
- Subject: Re: One IBAction, multiple results from multiple methods
- From: "Paul Sanders" <email@hidden>
- Date: Thu, 26 Feb 2009 15:50:15 -0000
Tags are a pain because they are numbers, rather than symbols, and (I
believe) IB does not enforce uniqueness which could lead to all kinds of
mayhem. I would avoid them, personally, in the interests of
maintainability. A few extra methods is a small price to pay for the sake
of future-proofing your code.
What IB should do, of course, is let you type in symbolic names for your
tags and generate an include file containing a set of unique #defines.
That's what I'm used to on a certain other OS, anyway.
Cheers - Paul.
----- Original Message -----
From: "I. Savant" <email@hidden>
To: "Peter Ilberg" <email@hidden>
Cc: <email@hidden>
Sent: Thursday, February 26, 2009 3:35 PM
Subject: Re: One IBAction, multiple results from multiple methods
On Thu, Feb 26, 2009 at 10:16 AM, Peter Ilberg <email@hidden>
wrote:
> Depending on your scenario, you might be able to encode the different
> cases
> into bitfields. The above function then turns into something like this:
That's certainly unique. :-) However, IMO, a bit less readable and
definitely less flexible. Less readable because the relationship
between sender/tag/intention isn't there in front of you. Less
flexible because you can't use the tags as unique control IDs for use
in other situations (because they must be a certain value for this to
work).
Interesting suggestion, though!
--
I.S.
_______________________________________________
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
_______________________________________________
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