I have an app that functions correctly in 10.3.x but has an odd behavior in 10.4.x.
The app processes multi-page PDF files and has an NSImageView to preview them. This view consistently displays the current page in 10.3.x, but in 10.4 it will only display the first page. What is weird is that if I set the current page to some number (say, 10) and resize the window, the correct page will be displayed - but if I then go to the next page (say, 11) the NSImageView displays the first page again!?!
Here's how I'm doing the image view. In the code fragment, "documentRep" is the NSPDFImageRep, "document" is the NSImage it belongs to and "myView" is the NSImageView.
[myView setImage:document]; . . . [documentRep setCurrentPage:pageNumber]; [document recache];
As I mention, this behaves as expected in 10.3.x. I have also tried the following approach:
[document release]; [documentRep setCurrentPage:pageNumber]; [documentRep recache]; document = [[NSImage alloc] init]; [document addRepresentation:documentRep]; [myView setImage:document];
This code behaves the same as the first snippet.
I've googled around and everything I've found says that these methods should work. Am I missing something? The fact that it displays the correct page during/after a resize but then jumps back to the first page the next time I call setCurrentPage is just weird...
|