Tag: uiimagepickercontroller

iOS 8 SDK:模态UIWebView和相机/图像select器

我发现,编译iOS 8(并在iOS 8中运行)时, UIWebView无法显示相机/图像select器,如果UIWebView在模态呈现的视图控制器中。 它可以在视图控制器中直接从窗口rootViewController或从其中推送的视图控制器中“挂起”,而没有问题。 testing应用程序可以在https://dl.dropboxusercontent.com/u/6214425/TestModalWebCamera.zipfind,但我会在下面描述。 我的testing应用程序(用故事板构build,但真正的应用程序不使用它们)有两个视图控制器(非原名称的ViewController和ViewController2 )。 ViewController包含在作为根视图控制器的UINavigationController中。 ViewController包含一个UIWebView (工作正常),一个“显示”(“推”)button和一个UIBarButtonItem ,它模态地呈现ViewController2 。 ViewController2有另一个UIWebView ,当“推”,而不是“呈现”时,工作。 ViewController和ViewController2都加载了: – (void)viewDidLoad { [super viewDidLoad]; [self.webView loadHTMLString:@"<input type=\"file\" accept=\"image/*;capture=camera\">" baseURL:nil]; } 当试图使用模式UIWebView Xcode在控制台中打印以下内容并解散应用程序模式: Warning: Attempt to present <UIImagePickerController: 0x150ab800> on <ViewController2: 0x14623580> whose view is not in the window hierarchy! 我目前的理论是, UIActionSheet到UIAlertController的变化可能产生了这种情况,但是很难certificate。 以防万一,我会打开雷达与苹果,以防万一。 有人发现相同的情况和一些解决方法?

我怎样才能得到通过iPhone中的照片库采摘的图像的名称?

我正在iphone应用程序中从照片库中select一个图像。 我将如何检索实际的图像名称。 在.h类 UIImageView * imageView; UIButton * choosePhotoBtn; 在.m类 -(IBAction) getPhoto:(id) sender { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; if((UIButton *) sender == choosePhotoBtn) { picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; } else { picker.sourceType = UIImagePickerControllerSourceTypeCamera; } [self presentModalViewController:picker animated:YES]; } – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; imageView.image = [info […]