loganwright / SimpleCam

A Memory Efficient Drop In Replacement / Alternative for the Native UIImagePicker Camera
Mozilla Public License 2.0
210 stars 37 forks source link

Crash invoking SimpleCam #11

Open EpicDraws opened 10 years ago

EpicDraws commented 10 years ago

I get this crash every time when trying to present SimpleCam:

2014-09-19 17:53:37.988 Social Stitch[73038:884614] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' *\ First throw call stack: ( 0 CoreFoundation 0x000000010dfc33f5 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010d905bb7 objc_exception_throw + 45 2 CoreFoundation 0x000000010deae4d3 -[__NSArrayM objectAtIndex:] + 227 3 Social Stitch 0x000000010a382829 -[SimpleCam viewDidLoad] + 2873 4 UIKit 0x000000010c2e8190 -[UIViewController loadViewIfRequired] + 738 5 UIKit 0x000000010c2e838e -[UIViewController view] + 27 6 UIKit 0x000000010c88583f -[_UIFullscreenPresentationController _setPresentedViewController:] + 65 7 UIKit 0x000000010c2c3c49 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 105 8 UIKit 0x000000010c2f4121 -[UIViewController _presentViewController:withAnimationController:completion:] + 1746 9 UIKit 0x000000010c2f6461 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132 10 UIKit 0x000000010c2f6385 -[UIViewController presentViewController:animated:completion:] + 229 11 UIKit 0x000000011d6999de -[UIViewControllerAccessibility presentViewController:animated:completion:] + 101

This is how I am invoking it: SimpleCam * simpleCam = [[SimpleCam alloc] init]; simpleCam.delegate = self; [self presentViewController:simpleCam animated:YES completion:nil];

Hopefully I am just missing something simple, as this library looks great!

EpicDraws commented 10 years ago

Strangely enough, this only happens when using the Cocoapod. When I download from here and use directly it is fine. Perhaps the Cocoapod needs to be updated?

loganwright commented 10 years ago

I won't be around until next week, but thanks for pointing this out. I'm not really sure what could be causing an array range exception.

Couple questions:

Which Xcode? Which iOS (7,8)? Is this happening on simulator and device?