tags:

views:

127

answers:

1

Hi there, I have this really simply code:

myPageRef = CGPDFDocumentGetPage(myDocumentRef,CGPDFPageGetPageNumber(myPageRef)+1);
if (CGPDFPageGetPageNumber(myPageRef) == CGPDFDocumentGetNumberOfPages(myDocumentRef)) {
    succBtn.enabled = NO;
}
precBtn.enabled = YES;

[tiledLayer performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:0 waitUntilDone:NO];

That I used to browse a PDF document page by page.

This code works on iPhone 3.1.2 and above.

This code works on iPad too.

BUT ...

This code DOESN'T work on iOS4.

The performSelectorOnMainThread:@selector(setNeedsDisplay) doesn't fire the drawLayer method that let me draw the new page to display.

Can someone tell me why?????

Thanks-In-Advance.

A: 

It could be related to this race condition, do you implement an empty -drawRect:?

Graham Lee
Yes I did implement it empty.
Oscar Peli