我几乎没有问题。
1)在我的ios应用程序中,我需要获取用户拍摄的图像的确切名称,以便将其写入我文档目录中的plist。
2)如何保存用户在文档目录中拍摄的所有图像。我是否必须在文档目录中创建单独的图像文件夹?我对节目非常天真。请让我知道确切的方法。
以下是我的代码。我在图像视图中显示图像,但我想知道图像的名称。
-(void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
self.employeeImage.image = image;
[self dismissModalViewControllerAnimated:YES];
}
- (IBAction)addOrEditEmployee:(id)sender
{
Employee *newEmployee = [[Employee alloc] init];
newEmployee.name = nameTextField.text;
//newEmployee.imageName = ; // need to get image name somewhere in imagePickerController method
newEmployee.position = positionTextField.text;
EmployeeRepository *employeeRepo = [[EmployeeRepository alloc] init];
[employeeRepo addNewEmployee:newEmployee];
}