Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSConnection release] anxiety



On May 4, 2005, at 8:25 PM, James Bucanek wrote:
My main problem is the lifetime of the NSConnection object itself. Everything else pretty much takes care of itself, but I can't determine a definative time when the NSConnection object can be released.

If I let my application leak NSConnection objects, it works fine.  ;)

If no one can come up with an answer to this, I might end up creating an NSConnection pool/factory and do some "lazy" garbage collection.

This sounds like a candidate for one of the -performSelector... methods in NSObject, with a delay of 0. Delayed performs are good for cases when you:


(a) can't send the message you want to send (like -release) right this moment, because

(b) you're in the middle of something (like using the object you would be releasing), but

(c) you want to send the message just as soon as you're done with that something.

Your idea of a NSConnection pool would essentially be a hand-rolled version of delayed performs.

--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: [NSConnection release] anxiety (From: James Bucanek <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.