• 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: Manual KVO and will/didChangeValueForKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Manual KVO and will/didChangeValueForKey


  • Subject: Re: Manual KVO and will/didChangeValueForKey
  • From: mmalcolm crawford <email@hidden>
  • Date: Thu, 2 Jun 2005 23:51:21 -0700


On Jun 2, 2005, at 11:27 PM, Andrew White wrote:

I'm basically wanting to define a property on B that says 'B objectInKeyAtIndex: X' returns whatever 'A objectInKeyAtIndex: X' would return, with the caveat that A.key is either static or updated as a complete entity. The A objectInKeyAtIndex values are created on demand based on a block of raw data (from an incoming data packet), which is why I'm leery of creating a regular 'A setKey' accessor, since that's not really what's happening.


If you want to simulate an array relationship, you should use the array notifications:


- (void)willChange:(NSKeyValueChange)change valuesAtIndexes: (NSIndexSet *)indexes forKey:(NSString *)key

- (void)didChange:(NSKeyValueChange)change valuesAtIndexes: (NSIndexSet *)indexes forKey:(NSString *)key

<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Protocols/NSKeyValueObserving.html>



although it's not clear from the description above that any change notification is necessary on a per-item basis (if it's simply the case that you want to read values and "pretend" that they don't change?)?

mmalc


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Manual KVO and will/didChangeValueForKey
      • From: Andrew White <email@hidden>
References: 
 >Manual KVO and will/didChangeValueForKey (From: Andrew White <email@hidden>)
 >Re: Manual KVO and will/didChangeValueForKey (From: Tim Lucas <email@hidden>)
 >Re: Manual KVO and will/didChangeValueForKey (From: mmalcolm crawford <email@hidden>)
 >Re: Manual KVO and will/didChangeValueForKey (From: Andrew White <email@hidden>)
 >Re: Manual KVO and will/didChangeValueForKey (From: mmalcolm crawford <email@hidden>)
 >Re: Manual KVO and will/didChangeValueForKey (From: Andrew White <email@hidden>)

  • Prev by Date: Re: Manual KVO and will/didChangeValueForKey
  • Next by Date: Re: Core Data Abstractions
  • Previous by thread: Re: Manual KVO and will/didChangeValueForKey
  • Next by thread: Re: Manual KVO and will/didChangeValueForKey
  • Index(es):
    • Date
    • Thread