[__ NSPlaceholderArray initWithObjects:count:]:尝试从对象[0]'中插入nil对象。

时间:2015-06-05 12:30:25

标签: ios imageview

uitableviewcell按钮点击事件中共享图片,以便在uitableview imageview图像共享中共享图像

-(void)yourButtonClicked:(UIButton*)sender
{

CustomTableViewCell *clickedCell = (CustomTableViewCell *)[[sender superview] superview];
NSIndexPath *clickedButtonIndexPath = [Mytableview indexPathForCell:clickedCell];

int selectedIndexPath = clickedButtonIndexPath.row;
NSLog(@"SelectedIndexPath: %d",selectedIndexPath);
UIImageView * imageshow;
UIImage* imge = [[arry objectAtIndex:selectedIndexPath]valueForKey:@"post_image"];
NSLog(@"imahe : = %@",imge);
imageshow.image = imge;
 NSString *textToShare = @"Vocabmeme image";
    UIImage *imageToShare = imageshow.image;
    NSArray *itemsToShare = @[textToShare,imageToShare];
    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
    activityVC.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll]; //or whichever you don't need
    [self presentViewController:activityVC animated:YES completion:nil];

}

0 个答案:

没有答案