iOS4 UIImagePickerController不支持mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]? [英] iOS4 UIImagePickerController doesn't suport mediaTypes = [NSArray arrayWithObject:(NSString *) kUTTypeMovie]?
本文介绍了iOS4 UIImagePickerController不支持mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我想以视频模式打开相机。所以我写下面的代码
In my application,I want to open the camera in Video mode.So I write the following codes
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[window addSubview:viewController.view];
[window makeKeyAndVisible];
UIImagePickerController *ipc;
ipc = [[UIImagePickerController alloc] init];
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.mediaTypes = [NSArray arrayWithObject:(NSString *) kUTTypeMovie];
[viewController presentModalViewController:ipc animated:YES];
return YES;
}
此代码适用于iPhone 3.1.3,但在iOS4上不起作用。
我可以在iOS4上使用UIImagePickerController作为视频吗?
This code is good for iPhone 3.1.3 but, on iOS4 does not work. Can I use UIImagePickerController as a Video on iOS4?
推荐答案
我是iphone开发的新手,但我有同样的问题,我解决了设置像这样的mediaTypes的问题
I'm new on iphone develop but i had the same problem and I solved that problem setting the mediaTypes like this
NSArray* mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera]
ipc.mediaTypes = mediaTypes;
这样您就可以访问视频和照片,希望对您有所帮助
This allow you to have acces to the video and photo, i hope this help you
这篇关于iOS4 UIImagePickerController不支持mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文