【发布时间】:2012-07-21 06:50:56
【问题描述】:
我是 iPhone 开发的新手。我需要制作一个应用程序,用户可以在其中拍照,然后将其保存在 iPhone 上,而且我必须使用 SQLite 数据库来存储图像并稍后显示它。
谁能帮我提供示例代码和程序说明?
编辑:我制作了一个使用 UIImageView 拍照的按钮,但我不确定它是否有效,因为我没有 iPhone:
if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera])
{
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType =
UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage,nil];
imagePicker.allowsEditing = NO;
[self presentModalViewController:imagePicker animated:YES];
imagePicker = nil;
newMedia = YES;
}
以上代码使用前置摄像头
【问题讨论】:
-
Shahnawaz - 有很多关于这个主题的教程,还有 Apple 的 WWDC 视频,甚至 YouTube 上的视频。你有没有努力去寻找这些资源?
-
我正在寻找有关如何存储文件路径以及如何保存图片的建议。我尝试了一些我不知道有必要展示它的东西,但我会编辑帖子并现在展示它。
标签: iphone objective-c ios ios5 ios4