Ios5 如何将用户拍摄的照片存储在手机中,并在iOS中创建内部SQLite3数据库

Ios5 如何将用户拍摄的照片存储在手机中,并在iOS中创建内部SQLite3数据库,ios5,camera,Ios5,Camera,在你给我任何反对票或评论之前。请阅读以下内容: 我是ios开发新手,现在我正在使用这个应用程序。我已经使用UIImagePickerController完成了摄像头Api。但是,我试图做的是让用户存储他/她在手机中拍摄的图片,我将创建一个内部SQLite3数据库,将图片在手机上存储的路径存储在数据库中(而不是图片本身),然后将所有信息存储在数据库中。如果您能提供我的链接教程或任何指导,我将非常感激。我已经检查了在线和堆栈溢出,我找不到我正在寻找的答案 这里是我的相机API代码: ViewConr

在你给我任何反对票或评论之前。请阅读以下内容:

我是ios开发新手,现在我正在使用这个应用程序。我已经使用UIImagePickerController完成了摄像头Api。但是,我试图做的是让用户存储他/她在手机中拍摄的图片,我将创建一个内部SQLite3数据库,将图片在手机上存储的路径存储在数据库中(而不是图片本身),然后将所有信息存储在数据库中。如果您能提供我的链接教程或任何指导,我将非常感激。我已经检查了在线和堆栈溢出,我找不到我正在寻找的答案

这里是我的相机API代码:

ViewConroller.H

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController <UIImagePickerControllerDelegate,         UIImagePickerControllerDelegate>
@property (retain, nonatomic) IBOutlet UIImageView *imageView;
@property (strong, nonatomic) IBOutlet UIButton *Camera;

-(IBAction)buttonPressed:(UIButton *)sender;
@end
我是用故事板,Xcode 4.6.3做的

提前感谢使用核心数据。 在这里可以找到一个很好的视频教程:

注意第13课和第14课

 #import "ViewController.h"

 @interface ViewController ()

 @end

 @implementation ViewController

  - (void)viewDidLoad
  {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
if (![UIImagePickerController     isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {

    UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Error"
                                                          message:@"Device has no camera"
                                                         delegate:nil
                                                cancelButtonTitle:@"OK"
                                                otherButtonTitles: nil];

    [myAlertView show];

}


// Do any additional setup after loading the view, typically from a nib.
 }

 - (void)didReceiveMemoryWarning
 {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
 }
 - (IBAction)buttonPressed:(UIButton *)sender {

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentViewController:picker animated:YES completion:NULL];

  }
   - (void)imagePickerController:(UIImagePickerController *)picker    didFinishPickingMediaWithInfo:(NSDictionary *)info {

UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
self.imageView.image = chosenImage;

[picker dismissViewControllerAnimated:YES completion:NULL];

 }

 - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {

[picker dismissViewControllerAnimated:YES completion:NULL];

 }

  - (void)dealloc {
[_imageView release];
[super dealloc];
 }


 @end