How to load photos from photo gallery and store it into application project?

前端 未结 3 1126
独厮守ぢ
独厮守ぢ 2021-02-01 09:13

I\'m working on an application that is almost the same as the sample codes i found here. But the method i want to do is different from the sample codes.
Link: PhotoLocations

3条回答
  •  清酒与你
    2021-02-01 09:59

    UIImagePickerController *cardPicker = [[UIImagePickerController alloc]init];
    cardPicker.allowsEditing=YES;
    cardPicker.delegate=self;
    cardPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    [self presentModalViewController:appDelegate.cardPicker animated:YES];
    [cardPicker release];
    

    And this delegate method will return the image u select from the album

    -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo 
    {
        [[picker parentViewController] dismissModalViewControllerAnimated:YES];
        noImage.image=img;
    }
    

提交回复
热议问题