ADGraphView icon indicating copy to clipboard operation
ADGraphView copied to clipboard

NSException Error occurs when plugging into iOS7

Open chrismartello opened this issue 10 years ago • 4 comments

When put into iOS7, and attempt to render with default data, a nice NSException error occurs like so:

2014-03-11 19:30:13.036 myAPP[12103:a0b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[**NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' * First throw call stack: ( 0 CoreFoundation 0x0000000102fbd795 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x0000000101e59991 objc_exception_throw + 43 2 CoreFoundation 0x0000000102f86ffe -[_NSPlaceholderDictionary initWithObjects:forKeys:count:] + 382 3 CoreFoundation 0x0000000102fb254f +[NSDictionary dictionaryWithObjects:forKeys:count:] + 63 4 myAPP 0x000000010000c956 -[GraphScrollableArea drawDateForDayNumber:] + 726 5 myAPP 0x000000010000d5cc -[GraphScrollableArea drawRect:] + 1436 6 UIKit 0x00000001008df651 -[UIView(CALayerDelegate) drawLayer:inContext:] + 474 7 QuartzCore 0x00000001002d6588 -[CALayer drawInContext:] + 116 8 QuartzCore 0x00000001001dd393 CABackingStoreUpdate + 2641 9 QuartzCore 0x00000001002d6494 ___ZN2CA5Layer8display_Ev_block_invoke + 59 10 QuartzCore 0x00000001002d6333 _ZN2CA5Layer8display_Ev + 1461 11 QuartzCore 0x00000001002cb393 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 319 12 QuartzCore 0x00000001002cb415 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 35 13 QuartzCore 0x0000000100240694 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 252 14 QuartzCore 0x000000010024170c _ZN2CA11Transaction6commitEv + 394 15 QuartzCore 0x0000000100241d79 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89 16 CoreFoundation 0x0000000102f88ff7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 17 CoreFoundation 0x0000000102f88f67 __CFRunLoopDoObservers + 391 18 CoreFoundation 0x0000000102f686d2 __CFRunLoopRun + 946 19 CoreFoundation 0x0000000102f67f33 CFRunLoopRunSpecific + 467 20 GraphicsServices 0x00000001032333a0 GSEventRunModal + 161 21 UIKit 0x0000000100884043 UIApplicationMain + 1010 22 myAPP 0x0000000100005063 main + 115 23 libdyld.dylib 0x0000000106b1b7e1 start + 0 ) libc++abi.dylib: terminating with uncaught exception of type NSException

chrismartello avatar Mar 11 '14 23:03 chrismartello

Hello chrismartello, It's really strange, but i have no exceptions at startup on iOS7 and above. Did you make any changes in viewController code or any other classes?

Antondomashnev avatar Mar 13 '14 19:03 Antondomashnev

Hello Anton, So, I'm attempting to use this in an application (and I do like it by the way), but it throws that error when trying to put it into a story board. Is there something I'm missing?

  • If I give the ADGraphView it's own storyboard screen (viewController), how should it be wired up to render?
    • Did I miss wiring it up somehow to the view? (thought it was just a drop in class and go? ) - hint: I used my view just like yours; separate h, m file with all the imports and same code and everything else.

I'd be grateful if you could help me resolve the above error. -Thanks, Chris M

chrismartello avatar Mar 13 '14 23:03 chrismartello

Ok, Could you try to add GraphView as a subview from code (not in storyboard) to your viewController just like in demo project. I've tested it and in work fine.

Antondomashnev avatar Mar 16 '14 08:03 Antondomashnev

Thanks Anton. I've attempted to render a subview from code and the above error occurs. I can run the project 'as is' in iOS7, but when I attempt to display as a ViewController from inside my app, I get an error. Am I missing some wiring or some code somewhere else in the project? That error, by the way, I've had no luck debugging it. I can't find where it breaks (debug mode, step by step, etc.).

Thanks again. -C

chrismartello avatar Mar 19 '14 01:03 chrismartello