• 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: Extending KVO to scalar struct types?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extending KVO to scalar struct types?


  • Subject: Re: Extending KVO to scalar struct types?
  • From: Graham Cox <email@hidden>
  • Date: Fri, 29 Aug 2014 15:56:27 +1000

On 29 Aug 2014, at 3:48 pm, Graham Cox <email@hidden> wrote:

> I already know that a given property of a given object is a CGSize (say)


You might wonder if I already know the type why this is even useful.

In a UI, different controls might set values independenty such as the x and y of a point. Each control is actually setting the same property (a point), but driving separate parts of it (the x and y). The UI controller is simplified if it can treat compound properties as if they were a single value, e.g. location.x, location.y, otherwise every time I set x, I have to go and fetch y as well and set both together (in reality that's still what I'm doing, but the very high level code that responds to the control doesn't need to know about it - it can just call my unwrapper with a keypath extended to include the field). Since I have hundreds of properties driven by UI this way (including multiple values across an array of objects), it's a big saving to genericise it.

--Graham



_______________________________________________

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: Extending KVO to scalar struct types?
      • From: Graham Cox <email@hidden>
References: 
 >Extending KVO to scalar struct types? (From: Graham Cox <email@hidden>)
 >Re: Extending KVO to scalar struct types? (From: Ken Thomases <email@hidden>)
 >Re: Extending KVO to scalar struct types? (From: Graham Cox <email@hidden>)
 >Re: Extending KVO to scalar struct types? (From: Quincey Morris <email@hidden>)
 >Re: Extending KVO to scalar struct types? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Extending KVO to scalar struct types?
  • Next by Date: Re: Extending KVO to scalar struct types?
  • Previous by thread: Re: Extending KVO to scalar struct types?
  • Next by thread: Re: Extending KVO to scalar struct types?
  • Index(es):
    • Date
    • Thread