objective c - UIImagePickerController as Camera mode crashes on ios 7? -
these 4 lines causes app crash. if change uiimagepickercontrollersourcetypephotolibrary
source type works charm. has nothing current app. create new project , added these 4 lines uibutton , still crashes.
uiimagepickercontroller* picker = [[uiimagepickercontroller alloc] init]; picker.sourcetype = uiimagepickercontrollersourcetypecamera; [self addchildviewcontroller:picker]; [self.view addsubview:picker.view];
i've tried
[self presentviewcontroller:picker animated:yes completion:^{}];
and
popcontroller = [[uipopovercontroller alloc] initwithcontentviewcontroller:picker]; [popcontroller presentpopoverfromrect:button.bounds inview:button permittedarrowdirections:uipopoverarrowdirectionany animated:yes];
it cause crash:
* terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[__nsplaceholderdictionary initwithobjects:forkeys:count:]: attempt insert nil object objects[0]' * first throw call stack: (0x2e17af53 0x388f06af 0x2e0b923b 0x2e0b9003 0x30961f39 0x30961ba1 0x308fa1b7 0x346f5e9b 0x308ec023 0x3057524b 0x30570a5b 0x305708ed 0x305702ff 0x3057010f 0x308e4343 0x2e1461d5 0x2e143b79 0x2e143ebb 0x2e0aece7 0x2e0aeacb 0x32d89283 0x30950a41 0x18135 0x38df8ab7) libc++abi.dylib: terminating uncaught exception of type nsexception
running ios 7.0.2 on ipad 2.
uiimagepickercontroller* picker = [[uiimagepickercontroller alloc] init]; picker.sourcetype = uiimagepickercontrollersourcetypecamera; [self addchildviewcontroller:picker]; [self.view addsubview:picker.view];
i have tested on device , works looks have not checked put brake point , check on line app crashes
Comments
Post a Comment