如何使用ELCImagePickerController和ALAssetsLibrary在照片库中选择多个图像?

时间:2013-08-14 12:47:57

标签: iphone ios elcimagepickercontroller

我是新手,请告诉我如何在照片库中选择多张图片。我一直在搜索解决方案一周,但没有为我的代码找到相关的解决方案。 根据我的代码,我可以一次选择一个图像。这就是我的代码现在的样子:

-(IBAction) photosClick
{
    ipc= [[UIImagePickerController alloc] init];
    ipc.delegate= self;
    ipc.sourceType= UIImagePickerControllerSourceTypePhotoLibrary;
    [self presentModalViewController: ipc animated:YES];
}
-(void) imagepickerControllerDidCancel: (UIImagePickerController *)picker
{
    [[picker parentViewController] dismissViewControllerAnimated:YES completion: nil];
    [picker release];
}
-(void) imagePickerController: (UIImagePickerController *)picker didFinishPickingMediaWithInfo: (NSDictionary *)info
{
    UIImage *image;
    NSURL *mediaURL;
    mediaURL= (NSURL *)[info valueForKey: UIImagePickerControllerReferenceURL];
    NSString *imagePath= [[NSString alloc] init];
    imagePath= [mediaURL absoluteString];
    NSLog(@"path of the image is: %@", imagePath);
    image= (UIImage *) [info valueForKey: UIImagePickerControllerOriginalImage];
    imageView.image= image;
    [picker dismissModalViewControllerAnimated:YES];
    [picker release];
}
-(void) imagePickerControllerDidCancel: (UIImagePickerController *)picker
{
    [picker dismissModalViewControllerAnimated:YES];
}

请通过编辑我的代码帮助我解决这个问题,以便我能够理解。我一直坚持这个,没有得到任何解决方案。

1 个答案:

答案 0 :(得分:2)

我可以为您提供比ELC图像选择器控制器更好的库。这已经在多个应用程序中使用,并且可以更加自定义。

请检查QBImagePickerController