Re: PDFView setDocument: autorelease crash?
Re: PDFView setDocument: autorelease crash?
- Subject: Re: PDFView setDocument: autorelease crash?
- From: Chris Ryland <email@hidden>
- Date: Sun, 11 Mar 2007 21:23:46 -0400
On Mar 10, 2007, at 9:52 AM, Keith Blount wrote:
(void)loadPDFDocumentFromFile:(NSString *)filePath
{
NSURL *fileURL = [NSURL fileURLWithPath:filePath];
PDFDocument *pdfDoc = [[PDFDocument alloc] initWithURL:fileURL];
[pdfView setDocument:pdfDoc];
}
The crashes go away, but this just does not seem right. The docs
say that -setDocument: releases the current PDFDocument before
loading the new one, so I would have thought that it would retain
the newly loaded document, but these crashes seem to indicate,
strangely, that it does not.
Is this a bug in PDFView, or have I missed something obvious?
I'm a Cocoa relative newcomer, but I thought the general pattern was
that
[[AnyClass alloc] initWithSomeKindOfArg: arg]
returned an object already auto-released.
Cheers!
--Chris Ryland / Em Software, Inc. / www.emsoftware.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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