Main app stop responding to events after UIViewController ends

29 views
Skip to first unread message

david rene comba lareu

unread,
Jan 7, 2014, 4:03:31 PM1/7/14
to haxe...@googlegroups.com
Hi,

NOTE: i'm using openfl

i'm still with my adventure trying to code this iOS extension tongue out Now, i'm simply trying to show the camera or photo library so the user can select an image and return to the app. I could finally do it, but the problem that i'm facing, is that when the UIViewController ends (why the user selected an image or why the user pressed cancel) the app works, but events stopped working.

my UIViewController is defined like this:


@interface IOSNativeCb : UIViewController 
- (void)imagePickerControllersadUIImagePickerController *)picker didFinishPickingMediaWithInfosadNSDictionary *)info;
@end

@implementation IOSNativeCb
- (void)imagePickerControllersadUIImagePickerController *)picker 
didFinishPickingMediaWithInfosadNSDictionary *)info {

[picker dismissModalViewControllerAnimated:YES];
[picker release];
//log all the dictionary of the selected image
for (id key in info) {
NSLog(@"key: %@, value: %@ \n", key, [info objectForKey:key]);
}
}
//if user canceled
- (void)imagePickerControllerDidCancelsadUIImagePickerController *)picker {
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[picker dismissViewControllerAnimated:YES completion:^{[self dismissViewControllerAnimated:YES completion:nil];}];
[self removeFromParentViewController];
[window makeKeyAndVisible];


}
@end


and i'm initializing with this from openfl:


const void initAppGallery(){
UIWindow *window = [UIApplication sharedApplication].keyWindow;
IOSNativeCb *wn = [[IOSNativeCb alloc] init];

[window addSubview: wn.view];
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
picker.delegate = wn;
[wn presentModalViewController:picker animated:YES];
[picker release];

}


tried several things in how i remove or dismiss the UIViewController to see if maybe the view still was principal and for that reason the events didn't worked anymore, but nothing far sad

any ideas of what i could try? anyone had any problem like this? is my first time coding in objetive-c, so i'm a bit lost of what functions or things could be the problem. i'm coding blind in a language i barely know tongue out

Regards.

Reply all
Reply to author
Forward
0 new messages