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: NSDocument/NSFileWrapper troubles: solved



Problem solved, thanks for the help, all. It was a combination of two retain problems - first, the stray [wrapper release] down in windowControllerDidLoadNib, and the second, accidentally releasing an autoreleased object deeper into my methods.

All in all, just another lesson that memory management's of the utmost importance in Cocoa.

~ Chris

On Thursday, July 31, 2003, at 8:58 AM, Christopher Erbach wrote:

I'm having troubles with some NSDocument code that I, a Cocoa newbie, wrote. I'm trying to preserve an NSFileWrapper passed by loadFileWrapperRepresentation:ofType: within the NSDocument. If I create a new file, I can save it, even multiple times, and all's well and good. However, when I load a file from disk and try to save it again, my application crashes.

If I comment out my "wrapper = newWrapper" line in loadFileWrapperRepresentation, the application runs and saves, albeit without loading any of the data. This looks eerily like a simple retain problem, but if it is, my newbie eye certainly can't find it.

I sliced the detailed pieces for loading and saving out of the routines. What's left is enough to cause the crashing behavior when saving files, which actually occurs after the loading/saving is complete during the event loop, not anywhere that's easily >> debuggable.

~ Chris Erbach
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: NSDocument/NSFileWrapper troubles (From: Derek Chesterfield <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.