ios - UIImagePickerController crashes when using PhotoLibrary as source -
i'm using xcode 5.1 , tested code both on ios7.1 , 7.0.2. app crashes uiimagepickercontroller in 2 scenarios on device:
1) when allowsediting
set yes, after crop picture , press "choose", goes own view, app crashes
2) inside uiimagepickercontroller
, when go photo list album list , @ bottom of photo list, crashes (no matter allowsediting
yes or not). note not crash if scrolled photo list up.
here code:
- (ibaction)photopickpressed:(id)sender { if ([self isphotolibraryavailable]) { self.imagepicker = [[uiimagepickercontroller alloc] init]; self.imagepicker.delegate = self; self.imagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; self.imagepicker.allowsediting = yes; nsstring *requiredmediatype = (__bridge nsstring*)kuttypeimage; self.imagepicker.mediatypes = [[nsarray alloc] initwithobjects:requiredmediatype, nil]; [self presentviewcontroller:self.imagepicker animated:yes completion:nil]; } } #pragma mark - image picker delegates - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info{ [picker dismissviewcontrolleranimated:yes completion:^(){ nslog(@"finished image picking"); }); } - (void)imagepickercontrollerdidcancel:(uiimagepickercontroller *)picker{ [picker dismissviewcontrolleranimated:yes completion:nil]; }
the crash message is
* terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[nsproxy doesnotrecognizeselector:scrollviewdidscroll:] called!'
note: not crash if use camera if set allowsediting
yes. only crashes on real devices, not on simulator.
just clarify (maybe unrelated), declared imagepicker as
uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init];
, , crashed. googled lot, , post says controller might recycled, , suggested declare in class definition. declared in class declartion:
@property (strong, nonatomic) uiimagepickercontroller *imagepicker;
thanks in advance.
update: tried put invoke of imagepickercontroller root view of app, , still crashes same message. shouldn't have scrollable view loaded yet.
after hours of investigation , tryout, confirmed caused third-party framework integrated app: empty app crashes uiimagepickercontroller
if link framework there.
thank help!
Comments
Post a Comment