gpt4 book ai didi

ios使用后如何关闭UIImagePickerController

转载 作者:行者123 更新时间:2023-12-01 18:30:21 25 4
gpt4 key购买 nike

我开发了一个应用程序,从他的代表那里收到我的代表后,我从相机 unitl 那里拍了一张照片,我解雇了,我收到了 exc_bad_access 这里是代码:

声明并打开相机:

-(void)ScattaFoto{
UIImagePickerController *picke = [[UIImagePickerController alloc] init];
// Delegate is self
picke.delegate = self;

// Allow editing of image ?
picke.allowsEditing=NO;


if(TARGET_IPHONE_SIMULATOR) {
picke.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}else{
picke.sourceType = UIImagePickerControllerSourceTypeCamera;
}

// Show image picker
[self presentModalViewController:picke animated:YES];

}

而不是委托(delegate)事件:
- (void) imagePickerController:(UIImagePickerController *)picke   didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// Access the uncropped image from info dictionary
//UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];

// [picker release];
[self dismissModalViewControllerAnimated: YES]; // Here i receive exc_bad_access
[picke release];
}

我将 .h 放在 imagePickerControl “UINavigationControllerDelegate,UIImagePickerControllerDelegate”的引用代表上

有人可以帮助我吗?

最佳答案

- (void) imagePickerController:(UIImagePickerController *)picke didFinishPickingMediaWithInfo:(NSDictionary *)info{
[picke dismissModalViewControllerAnimated: YES];
}

关于ios使用后如何关闭UIImagePickerController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9703949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com