On 25 Aug 2008, at 4:24 pm, Graham Cox wrote:


On 25 Aug 2008, at 4:17 pm, Negm-Awad Amin wrote:

Don't care about this. IF it is a singleton, retaining is no problem. IF it is NOT, retaining is the right way to handle it.


Sure, no problem for code I'm writing now.

Thing is, I never noticed this "tries to" before and always thought this was a singleton. So I have shipped code that doesn't retain the panel. It would be good to know if I'm just getting lucky *for now* or whether that code is reliable.


The sample code in Apple's docs does NOT retain the save panel. The example code for NSAlert similarly does not retain the alert - in fact it explicitly autoreleases it which is what I'd expect a convenience method to do if an individual instance were returned.

file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/AppFileMgmt/Tasks/UsingASavePanel.html

Since the example is presumed correct and in practice I've never run into a problem with this, it appears to be safe... in which case some clarification about what "tries to" means would still be good.


Graham
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to