当我使用iOS 8.0.2时,我的5s在Xcode 6.0.1上正常运行.但后来我升级到iOS 8.1,建立我的代码,我得到了一个错误说"的Xcode不能运行使用选定的设备.无支持的iOS设备是可用的.马克的iOS设备为'用于开发’来运行应用程序,或者选择iOS模拟器作为目的地." 那么我想我需要升级到Xcode 6.1,但我仍然遇到了同样的错误.奇怪的是在Windows>设备下我可以看到我的iPhone 5s信息.请提前帮助,谢谢.
在应用程序扩展中有一种方法可以从包含应用程序生成图像,该应用程序存储在/ var/mobile/Containers/Data/Application // Documents //文件夹中?
在iOS7中,内置相机应用程序在拍照后没有进入预览屏幕,UIImagePicker是否有任何表现方式.
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.cameraFlashMode = UIImagePickerControllerCameraFlashModeOff;
Run Code Online (Sandbox Code Playgroud)
我知道另一个解决方案是使用AVFoundation类创建一个自定义相机,但这是我不知道的,我真的很喜欢默认相机的外观.
更新
经过一些研究后我发现我可以创建自己的快门按钮并将其设置为相机覆盖.这就是我做的
UIButton *shutter = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[shutter addTarget:self action:@selector(shootPicture) forControlEvents:UIControlEventTouchUpInside];
[shutter setTitle:@"S" forState:UIControlStateNormal];
shutter.frame = CGRectMake(50, 50, 60, 60);
UIView *layoutView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
layoutView.opaque = NO;
layoutView.backgroundColor = [UIColor clearColor];
[layoutView addSubview:shutter];
Run Code Online (Sandbox Code Playgroud)
对于'shootPicture'方法
- (void) shootPicture
{
[picker takePicture];
[self imagePickerController:self.camCtl didFinishPickingMediaWithInfo:nil];
}
Run Code Online (Sandbox Code Playgroud)
如果我只是让选择器调用'takePicture',我仍然会得到预览,所以我强迫选择器在拍照后立即调用didFinishPickingMediaWithInfo.结果是我没有看到预览屏幕但是我也看不到图片.我知道我把'nil'放在didFinishPickingMediaWithInfo中因为我不知道在这一点上放什么.我也知道它在某个地方的缓存中拍了一张照片,但我真的不知道如何获得它.
任何想法将不胜感激=)