• 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: KVO one-step listening but two-step notifying?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVO one-step listening but two-step notifying?


  • Subject: Re: KVO one-step listening but two-step notifying?
  • From: Hamish Allan <email@hidden>
  • Date: Sat, 24 Dec 2005 01:21:42 +0000

On Fri Dec 23 10:34:57 2005, mmalcolm crawford wrote:

On Dec 22, 2005, at 6:23 PM, Hamish Allan wrote:

- (id)mergedArray
{
return [[_object1 individualArray] arrayByAddingObjectsFromArray:[_object2 individualArray]];
}

You can observe changes to each of those individualArrays, but by the time observeValueForKeyPath:... is called it's too late to call willChangeValueForKey:@"mergedArray" because -mergedArray will already be providing the new contents.

Store mergedArray as an instance variable. My guess would be that this will be more efficient anyway...?

True. I don't seem to be doing very well at coming up with examples, but I still feel that something isn't quite right. If it's important for me to notify observers of upcoming changes to properties, why can't I receive such notifications myself? It seems that this design doesn't allow for me to proxy data without copying it.

Thanks,
Hamish


_______________________________________________
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: KVO one-step listening but two-step notifying?
      • From: mmalcolm crawford <email@hidden>
References: 
 >KVO one-step listening but two-step notifying? (From: Hamish Allan <email@hidden>)
 >Re: KVO one-step listening but two-step notifying? (From: mmalcolm crawford <email@hidden>)
 >Re: KVO one-step listening but two-step notifying? (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: Crash in objc_msgSend_rtp when calling add action of NSArrayController
  • Next by Date: Core Data compare NSNumber question
  • Previous by thread: Re: KVO one-step listening but two-step notifying?
  • Next by thread: Re: KVO one-step listening but two-step notifying?
  • Index(es):
    • Date
    • Thread