• 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 persists too long
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVO persists too long


  • Subject: Re: KVO persists too long
  • From: "Jim Thomason" <email@hidden>
  • Date: Tue, 3 Jul 2007 09:50:13 -0500


> I'm not retaining it. Nor am I allocating it, copying it, or otherwise know > anything about its existence.

Actually, you are, just not the specific object you think is the culprit,
which probably isn't. The likely culprit is one of your own objects that
you
have told the UI to observe.


No, I wasn't. The problem was indeed one of those KVO forwarder objects and I was not allocating, copying, or otherwise aware of its existence. At least not directly. That specific object that I thought was the culprit most certainly was.

The issue(? or, at least the fix) was with the triggering of dependent
keys. I'd set up 2 sets of triggers for other dependent keys inside my debt
object. One went like this:

lineItems -> firstLineItem
firstLineItem -> apr
another went:
lineItems -> apr

So when I made a change in my list of line items, the debt object would note
that the lineItems had changed and mark firstLineItem as changed. It'd then
note that firstLineItem had changed and then update apr.

It would also go straight from seeing that lineItems had changed to updating
apr.

This -usually- worked. But some times, under some conditions (lots of line
items, usually), it would bomb out because one of the KVO forwarder objects
that had been created via these triggers had vanished. Most of the time it
was fine, sometimes - kaboom.

Solution? I took out the redundant trigger on firstLineItem -> apr and
everything now magically works. So apparently something about chaining
triggers in this fashion caused a problem some times. This reeks of a KVO
bug to me, but I haven't yet been able to boil it down into a succinct test
case to confirm and submit.

Ho hum. But hopefully this info about the redundant key triggers will help
somebody else out with similar issues.

-Jim...
_______________________________________________

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


References: 
 >Re: KVO persists too long (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: drag & drop objects
  • Next by Date: Re: Cocoa and dead-code stripping
  • Previous by thread: Re: KVO persists too long
  • Next by thread: Adding Images to a Cocoa Application in XCode
  • Index(es):
    • Date
    • Thread