You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm implementing leaves with Images. It was fine with upto ios6 but when I'm running this app in ios7 its going to crash. Following is the crash report of my app
I'm implementing leaves with Images. It was fine with upto ios6 but when I'm running this app in ios7 its going to crash. Following is the crash report of my app
2013-10-07 12:57:43.524 Books[1950:a0b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: 0)'
*** First throw call stack:
(
0 CoreFoundation 0x03c315e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x02c8f8b6 objc_exception_throw + 44
2 CoreFoundation 0x03cbb578 -[__NSDictionaryM setObject:forKey:] + 888
3 Books 0x0001c74d -[LeavesCache cachedImageForPageIndex:] + 317
4 Books 0x0000dbc6 -[LeavesView getImages] + 230
5 Books 0x00010bd0 -[LeavesView setCurrentPageIndex:] + 176
6 Books 0x0000dacb -[LeavesView reloadData] + 171
7 Books 0x00016774 -[LeavesViewController viewDidLoad] + 244
8 UIKit 0x00f909a8 -[UIViewController loadViewIfRequired] + 696
9 UIKit 0x00f90c44 -[UIViewController view] + 35
10 UIKit 0x00faaa72 -[UINavigationController _startCustomTransition:] + 778
11 UIKit 0x00fb7757 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
12 UIKit 0x00fb8349 -[UINavigationController __viewWillLayoutSubviews] + 57
13 UIKit 0x010f139d -[UILayoutContainerView layoutSubviews] + 213
14 UIKit 0x00ee7dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
15 libobjc.A.dylib 0x02ca181f -[NSObject performSelector:withObject:] + 70
16 QuartzCore 0x0200a72a -[CALayer layoutSublayers] + 148
17 QuartzCore 0x01ffe514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x01ffe380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
19 QuartzCore 0x01f66156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
20 QuartzCore 0x01f674e1 _ZN2CA11Transaction6commitEv + 393
21 QuartzCore 0x01f67bb4 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
22 CoreFoundation 0x03bf953e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 30
23 CoreFoundation 0x03bf948f __CFRunLoopDoObservers + 399
24 CoreFoundation 0x03bd73b4 __CFRunLoopRun + 1076
25 CoreFoundation 0x03bd6b33 CFRunLoopRunSpecific + 467
26 CoreFoundation 0x03bd694b CFRunLoopRunInMode + 123
27 GraphicsServices 0x035b99d7 GSEventRunModal + 192
28 GraphicsServices 0x035b97fe GSEventRun + 104
29 UIKit 0x00e7d94b UIApplicationMain + 1225
30 Books 0x0001c21d main + 125
31 libdyld.dylib 0x04ae6725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
And it's coming under following method
NSNumber *pageIndexNumber = [NSNumber numberWithInt:pageIndex];
UIImage *pageImage;
@synchronized (pageCache) {
pageImage = [pageCache objectForKey:pageIndexNumber];
}
if (!pageImage) {
CGImageRef pageCGImage = [self imageForPageIndex:pageIndex];
pageImage = [UIImage imageWithCGImage:pageCGImage];
@synchronized (pageCache) {
[pageCache setObject:pageImage forKey:pageIndexNumber];
}
}
return pageImage.CGImage;
}
The text was updated successfully, but these errors were encountered: