• 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: _NSKeyValueObservationInfoCreateByRemoving crashing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _NSKeyValueObservationInfoCreateByRemoving crashing


  • Subject: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
  • From: Stefan Fisk <email@hidden>
  • Date: Tue, 1 Nov 2005 20:41:25 +0100

I do see your point, but I'm not quite sure why i shouldn't be able to return a copy. But I am experiencing the exact same problem with the result class's other key - 'properties' - which internally is a mutable dictionary. From what i understand KVO should do the hard work for you, so that if any object in the observed key path changes you get notified properly anyway. If that is not the case i can understand fully why my code crashes.

The reason why I want to copy the engines is that you can make them perform commands, the result of which gets returned through notifications. I've tried various schemes to enable only one engine instance perform commands for several 'clients', but it's nowhere as clean as it could be if i was allowed to sprinkle copies wherever i felt like it.

A possible solution would be to just store the engine's path in the result, and then create a value transformer that converted it into the engine's localized name, but I'm not prepared to resort to such solutions until I understand why I'd have to.


1 nov 2005 kl. 19.20 skrev mmalcolm crawford:


On Nov 1, 2005, at 9:26 AM, Stefan Fisk wrote:

The Engine class only has one instance variable that identifies it, so the copyWithZone: just calls initWithPath:.

I'd *guess* that by returning a copy in the accessor you're subverting KVO and bindings in general, since the object being observed isn't the same as the property of the original (and it's continually changing with each access).


It's not clear why you would return a copy of an Engine -- from the name it sounds like something that would be a relationship rather than an attribute...?

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


_______________________________________________ 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: _NSKeyValueObservationInfoCreateByRemoving crashing
      • From: mmalcolm crawford <email@hidden>
References: 
 >_NSKeyValueObservationInfoCreateByRemoving crashing (From: Stefan Fisk <email@hidden>)
 >Re: _NSKeyValueObservationInfoCreateByRemoving crashing (From: Nicko van Someren <email@hidden>)
 >Re: _NSKeyValueObservationInfoCreateByRemoving crashing (From: Stefan Fisk <email@hidden>)
 >Re: _NSKeyValueObservationInfoCreateByRemoving crashing (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: IBPalette problem
  • Next by Date: Re: thread and run loop
  • Previous by thread: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
  • Next by thread: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
  • Index(es):
    • Date
    • Thread