2009-11-17 97 views
0

如果我的程序想要使用UIImagePicker(UIImagePickerControllerSourceTypeCamera)来访问Camera并使用UIImagePickerControllerSourceTypeCamera拍摄照片并回到应用程序,那么我的程序可以在iPhone上执行此操作,特别是在非越狱设备上? Apple允许这种程序在AppStore中上传吗? 我曾经见过某个地方,如果我们创建了这样的程序,Apple不允许这样做(从第三方应用程序访问相机)。是这样吗?iPhone:我的程序可以使用imagepicker API访问相机吗?

感谢您的建议。

谢谢。

-Prabakar。

+0

http://stackoverflow.com/从屏幕上删除它,在上面介绍,该模式的情况下问题/ 74113/access-the-camera-with-iphone-sdk – 2009-11-17 19:53:26

+0

我无法理解,为什么你不能只使用UIImagePicker?制作照片的标准控制。 – Morion 2009-11-17 19:53:57

回答

1

您使用UIImagePickerController直接:

UIImagePickerController *thePicker = [[UIImagePickerController alloc] init]; 
thePicker.delegate = thePickerDelegate; 
thePicker.sourceType = UIImagePickerControllerSourceTypeCamera; 

//Here you would present thePicker modally, and release it after this 
//It will be deallocated when you remove it from screen 
[anotherViewController presentModalViewController: thePicker animated:NO]; 
[thePicker release]; 

thePickerDelegate,实现

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo; 

image是你拍的照片,和你愿意,你可以操纵它。如果你想UIImagePickerController拍摄一张照片后dissapear,这是你会触发这个动作,并通过调用

[thePicker dismissModalViewControllerAnimated: NO]; 
+0

谢谢。如果我们离开“ThePicker”,这不是泄漏吗? – Stella 2009-11-17 20:01:39

+0

如果我们把它留在哪里?请解释你认为是泄漏的地方。 – luvieere 2009-11-17 20:06:18

+0

我在问,如果我们像下面那样分配,我们需要在哪里释放'thePicker'?我可以在'didFinishPickingImage'结束时释放它吗? UIImagePickerController * thePicker = [[UIImagePickerController alloc] init]; – Stella 2009-11-17 20:07:53

相关问题