헤더에 UINavigationController delegate와 UIImagePickerController Delegate를 추가하고
- (IBAction)getPhotos
{
UIImagePickerController *picker = [[[UIImagePickerController alloc]init] autorelease];
picker.delegate = self;
// picker.sourceType = UIImagePickerControllerSourceTypeCamera; //카메라로 찍어서 가져오기
// picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; //앨범에서 가져오기
[self presentModalViewController:picker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
//img에 선택한사진
}
'Objective-C' 카테고리의 다른 글
[iPhone] PHP연동시 한글 파라미터 넘기기 (0) | 2010.10.19 |
---|---|
[iPhone] Action Sheet사용하기 (0) | 2010.10.11 |
[iPhone] 애니메이션 및 페이드아웃 효과 (0) | 2010.10.07 |
[iPhone] UITextView 폰트, 사이즈 설정 (0) | 2010.10.07 |
[iPhone] UIActivityIndicatorView 사용하기 - 로딩표현 (0) | 2010.10.07 |