k06a / ABCalendarPicker

Fully configurable iOS calendar UI component with multiple layouts and smooth animations.
MIT License
710 stars 119 forks source link

While running the demo project I am getting the exception. #28

Closed arunkumariitkgp closed 10 years ago

arunkumariitkgp commented 10 years ago

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: 0)' * First throw call stack: ( 0 CoreFoundation 0x01e7c5e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x016a98b6 objc_exception_throw + 44 2 CoreFoundation 0x01f06578 -[NSDictionaryM setObject:forKey:] + 888 3 ABCalendarPickerDemo 0x0002520e -[UIMyButton setBackgroundImage:forState:] + 190 4 ABCalendarPickerDemo 0x00023442 81-[ABCalendarPickerDefaultStyleProvider calendarPicker:cellViewForTitle:andState:]_block_invoke + 2226 5 ABCalendarPickerDemo 0x00020554 -[ABViewPool giveExistingOrCreateNewWith:] + 660 6 ABCalendarPickerDemo 0x00022a89 -[ABCalendarPickerDefaultStyleProvider calendarPicker:cellViewForTitle:andState:] + 233 7 ABCalendarPickerDemo 0x0000db43 -[ABCalendarPicker updateButtonsForProvider:andState:] + 1107 8 ABCalendarPickerDemo 0x0001338c -[ABCalendarPicker changeStateTo:fromState:animation:canDiffuse:] + 5836 9 ABCalendarPickerDemo 0x00016cf9 -[ABCalendarPicker setState:animated:] + 601 10 ABCalendarPickerDemo 0x00016205 -[ABCalendarPicker initWithStyleProvider:weekdaysProvider:daysProvider:monthsProvider:yearsProvider:erasProvider:] + 1045 11 ABCalendarPickerDemo 0x0001655e -[ABCalendarPicker initWithDefaultProviders] + 382 12 ABCalendarPickerDemo 0x00016810 -[ABCalendarPicker initWithCoder:] + 176 13 UIKit 0x004b06f2 -[UIClassSwapper initWithCoder:] + 240 14 Foundation 0x010afd6a _decodeObjectBinary + 3498 15 Foundation 0x010aee55 _decodeObject + 340 16 Foundation 0x010aecf9 -[NSKeyedUnarchiver decodeObjectForKey:] + 181 17 UIKit 0x004b0288 -[UIRuntimeConnection initWithCoder:] + 191 18 Foundation 0x010afd6a _decodeObjectBinary + 3498 19 Foundation 0x010b1226 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 2204 20 Foundation 0x010b1495 -[NSArray(NSArray) initWithCoder:] + 255 21 Foundation 0x010afd6a _decodeObjectBinary + 3498 22 Foundation 0x010aee55 _decodeObject + 340 23 Foundation 0x010aecf9 -[NSKeyedUnarchiver decodeObjectForKey:] + 181 24 UIKit 0x004af702 -[UINib instantiateWithOwner:options:] + 1117 25 UIKit 0x00321c95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280 26 UIKit 0x0032243d -[UIViewController loadView] + 302 27 UIKit 0x0032273e -[UIViewController loadViewIfRequired] + 78 28 UIKit 0x00322c44 -[UIViewController view] + 35 29 UIKit 0x0024b5ad -[UIWindow addRootViewControllerViewIfPossible] + 66 30 UIKit 0x0024b947 -[UIWindow _setHidden:forced:] + 312 31 UIKit 0x0024bbdd -[UIWindow _orderFrontWithoutMakingKey] + 49 32 UIKit 0x0025644a -[UIWindow makeKeyAndVisible] + 65 33 ABCalendarPickerDemo 0x00002adb -[ABAppDelegate application:didFinishLaunchingWithOptions:] + 683 34 UIKit 0x00208f65 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309 35 UIKit 0x002097a5 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1536 36 UIKit 0x0020dfb8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 37 UIKit 0x0022242c -[UIApplication handleEvent:withNewEvent:] + 3447 38 UIKit 0x00222999 -[UIApplication sendEvent:] + 85 39 UIKit 0x0020fc35 _UIApplicationHandleEvent + 736 40 GraphicsServices 0x023fe2eb _PurpleEventCallback + 776 41 GraphicsServices 0x023fddf6 PurpleEventCallback + 46 42 CoreFoundation 0x01df7dd5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53 43 CoreFoundation 0x01df7b0b CFRunLoopDoSource1 + 523 44 CoreFoundation 0x01e227ec CFRunLoopRun + 2156 45 CoreFoundation 0x01e21b33 CFRunLoopRunSpecific + 467 46 CoreFoundation 0x01e2194b CFRunLoopRunInMode + 123 47 UIKit 0x0020d6ed -[UIApplication _run] + 840 48 UIKit 0x0020f94b UIApplicationMain + 1225 49 ABCalendarPickerDemo 0x000027f8 main + 168 50 ABCalendarPickerDemo 0x00002745 start + 53 ) libc++abi.dylib: terminating with uncaught exception of type NSException

I resolved this by checking whether the image object is nil or not.

But I am not getting the proper calendar view. Please look the screenshot. ios simulator screen shot 18-oct-2013 4 13 46 pm

k06a commented 10 years ago

Looks like bundle with resources is not connected

k06a commented 10 years ago

I've updated example right now for iOS7 and Xcode5. Close this issue if your problem was solved.

arunkumariitkgp commented 10 years ago

Thanks for the quick reply. That is not the issue. I am still getting the same Exception.

k06a commented 10 years ago

Try now :) added one more commit