我是iPhone
開發的新手。我需要製作一個應用程序,用戶可以在該應用程序中拍攝照片,然後將其保存在iPhone上,還必須使用SQLite
數據庫來存儲圖像並稍後顯示它。iOS幫助:如何使用相機拍照並將其保存在iPhone上?
任何人都可以幫助我的示例代碼和程序的解釋?
編輯:我做了一個使用的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 - 有任何的教程在那裏對這個話題,與蘋果的WWDC視頻,甚至在YouTube視頻。你有沒有努力去搜索這些資源? – 2012-07-21 07:12:43
我一直在尋找關於如何存儲文件路徑以及如何保存圖片的建議。我嘗試了一些我不知道它需要展示的東西,但是我現在編輯帖子並展示它。 – Shahnawaz 2012-07-22 04:55:51