• 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: "context-aware" bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "context-aware" bindings


  • Subject: Re: "context-aware" bindings
  • From: Joanna Carter <email@hidden>
  • Date: Sun, 27 Feb 2011 10:39:34 +0000

Le 27 févr. 2011 à 10:07, Andy Lee a écrit :

> On Feb 27, 2011, at 3:19 AM, Mikkel Eide Eriksen wrote:
>> I have a property on an object that would ideally return either its value or nil, depending on the context it's being called from.
>
> Can you tell us the name of the object and the property, and describe the different contexts? I'm having trouble imagining such a requirement.
>
>> I could do this with multiple selectors, but was wondering if there was a "cleaner" way of determining how it is being called.
>
> It seems to me a property that can return multiple values isn't really a property. It's either a method you pass a parameter to (to specify "context" -- which of course won't work for bindings), or it's multiple properties (i.e., multiple selectors -- what's not clean about that?).

There is certainly a design problem here. Why would two different callers expect a different result from a property, when one of those results is going to be nil?

If one of the callers is expecting nil returned, why bother calling the property?

Some idea of the code would be useful.

Joanna

--
Joanna Carter
Carter Consulting

_______________________________________________

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

  • Follow-Ups:
    • Re: "context-aware" bindings
      • From: Mikkel Eide Eriksen <email@hidden>
References: 
 >"context-aware" bindings (From: Mikkel Eide Eriksen <email@hidden>)
 >Re: "context-aware" bindings (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: "context-aware" bindings
  • Next by Date: Re: NSWindowController
  • Previous by thread: Re: "context-aware" bindings
  • Next by thread: Re: "context-aware" bindings
  • Index(es):
    • Date
    • Thread