indexForPage: page not found - Problem with PDFView on Tiger, works fine on Leopard
indexForPage: page not found - Problem with PDFView on Tiger, works fine on Leopard
- Subject: indexForPage: page not found - Problem with PDFView on Tiger, works fine on Leopard
- From: Kevin Ross <email@hidden>
- Date: Sun, 17 Feb 2008 13:07:35 -0800
Hi, I have recently stumbled upon a strange problem which I am at a
loss to solve. Any pointers would be greatly appreciated.
This snippet of code works fine on Leopard but not on Tiger.....
- (void)awakeFromNib {
NSString *outPath = [@"~/Desktop/debug.pdf"
stringByExpandingTildeInPath];
[self writeDebugPDFDocument:[self pdfDocument] toPath:outPath];
[self setPageCount:[pdfDocument pageCount]]; <---- pageCount = 1
(like it should)
[pdfView setDocument:[self pdfDocument]]; <------- Throws
exception here.
[self skipToPage:[NSNumber numberWithInt:1]];
[pdfView layoutDocumentView];
}
Debugger log output:
2008-02-17 12:26:51.163 Imposer[455] indexForPage: page not found
2008-02-17 12:26:51.163 Imposer[455] *** Uncaught exception:
<NSGenericException> indexForPage: page not found
Stack trace:
#0 0x92c0107c in _NSRaiseError
#1 0x92c00db8 in +[NSException raise:format:]
#2 0x9648b894 in -[PDFDocument indexForPage:]
#3 0x9648aaec in -[PDFView viewSizeForPage:]
#4 0x9648a1b0 in -[PDFView resizeDisplayView:]
#5 0x964899e0 in -[PDFView setDocument:]
#6 0x000d512c in -[KRImposerDocument awakeFromNib] at
KRImposerDocument.m:78
I added the first two lines of code to ensure that the document is
valid and that the page does in fact exist. When I check the document
that is written to the desktop, it does in fact have the page and
appears to be normal. I'm wondering why the PDFView is unable to
access the page when the document does in fact have the page.
I'm sure it's something I'm doing (possibly some autorelease
craziness?) since this snippet works fine when the document is opened
via the "Open" menu, and only happens when a new document has been
created programmatically from the originally opened one.
Let me know if I need to provide more information. Again, any
pointers would be greatly appreciated. Thanks for the help.
Kevin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden