• 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: PDFView setDocument: autorelease crash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: PDFView setDocument: autorelease crash?
      • From: Brian Ganninger <email@hidden>
References: 
 >PDFView setDocument: autorelease crash? (From: Keith Blount <email@hidden>)

  • Prev by Date: performclose vs close
  • Next by Date: Core Data Validation and -[NSCFNumber length]: selector not recognized
  • Previous by thread: PDFView setDocument: autorelease crash?
  • Next by thread: Re: PDFView setDocument: autorelease crash?
  • Index(es):
    • Date
    • Thread