I am having problems using choosing an image from my camera roll and assigning it to a new Tweet Sheet using the new Twitter framework. I can easily compose a new Tweet Sheet, that isn’t an issue. I have managed to gain access to the camera roll and assign the chosen image to a UIImageView but when I select the image I want it to immediately bring up the Tweet Sheet with the image already in it. To gain access to the camera roll I am using;
- (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;
}
}
Any help would be appreciated
Have you looked into ShareKit? It makes FaceBook and Twitter integration drop dead easy, among other services.