【发布时间】:2011-11-03 07:07:38
【问题描述】:
我在使用新的 Twitter 框架从相机胶卷中选择图像并将其分配到新的推文表时遇到问题。我可以轻松地撰写新的推文表,这不是问题。我已经设法访问相机胶卷并将所选图像分配给 UIImageView 但是当我选择图像时,我希望它立即调出已包含图像的推文表。访问我正在使用的相机胶卷;
- (void) selectImage
{
if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{
UIImagePickerController *imagePicker =
[[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType =
UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.mediaTypes = [NSArray arrayWithObjects:
(NSString *) kUTTypeImage,
nil];
imagePicker.allowsEditing = NO;
[self presentModalViewController:imagePicker animated:YES];
}
}
-(void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString *mediaType = [info
objectForKey:UIImagePickerControllerMediaType];
[self dismissModalViewControllerAnimated:YES];
if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
UIImage *image = [info
objectForKey:UIImagePickerControllerOriginalImage];
imageView.image = image;
imageView.hidden = YES;
}
}
任何帮助将不胜感激
【问题讨论】:
标签: iphone objective-c twitter uiimagepickercontroller