brow / leaves

A page-turning interface for iOS apps
Other
1.44k stars 332 forks source link

context error on iOS 4.2 #6

Closed arodeus closed 13 years ago

arodeus commented 14 years ago

Hi! I'm debugging my application on iOS 4.2 GM seed, and I obtain the following error on the simulator console:

: CGContextClipToRect: invalid context 0x0 : CGContextGetClipBoundingBox: invalid context 0x0 : CGContextConcatCTM: invalid context 0x0 : CGContextDrawImage: invalid context 0x0 : CGBitmapContextCreateImage: invalid context 0x0 : CGContextClipToRect: invalid context 0x0 : CGContextGetClipBoundingBox: invalid context 0x0 : CGContextConcatCTM: invalid context 0x0 : CGContextDrawImage: invalid context 0x0 : CGBitmapContextCreateImage: invalid context 0x0 Error seems issued by LeavesCache.m on the following member function - (CGImageRef) imageForPageIndex:(NSUInteger)pageIndex I just start to debug the application, so these are just my first impressions. Hope to a fix soon, or maybe an hint to fix the so problem so I'll be able to commit the fix. Thx, Diego
arodeus commented 13 years ago

SOLVED!

Preface: I load a LeavesController subclass as Modal View as Full Screen.

Why the error: Using iOS 4.2, load the subclass as modal view seems generate a double time call for (CGImageRef) imageForPageIndex:(NSUInteger)pageIndex (in LeavesCache.m) , generating a NULL when CGBitmapContextCreate is called.

Solution: I added the following code, return nil if CGBitmapContextCreate return NULL

if (context == nil) return nil;

VegetarianZombie commented 13 years ago

Almost a year later ... thanks for debugging this issue.

Jasmeet22 commented 11 years ago

iDidn't get the desired answer

Jasmeet22 commented 11 years ago

ok i got it thanx