2013-05-20 23 views
1

我有一些圖片&的文字,我想通過Facebook分享,嘰嘰喳喳,它工作得很好,但我想分享另一組數據(activityitems)與我的自定義UIActivity定製UIActivity含自定義數據

NSLog(@"The Selected Photo Count %i",[self.selectedPhotos count]); 

NSMutableArray *newArray=[[NSMutableArray alloc]init]; 
NSMutableArray *newArraytext=[[NSMutableArray alloc]init]; 



for (Shoplog * ChosenPhot in self.selectedPhotos) { 

    NSString *initalTextString = [NSString 
            stringWithFormat:@"I am Sending from my Shoplog Collection: %@", 
            ChosenPhot.categoryname]; 

    [newArraytext addObject:initalTextString]; 
    CreateShoplogTagImage *createimagetag=[[CreateShoplogTagImage alloc]init]; 
    UIImage *newimage=[createimagetag Imagetag:ChosenPhot]; 
    NSDictionary *flurrydicttionary3=[[NSDictionary alloc]initWithObjectsAndKeys:ChosenPhot.categoryname,@"SharedCategoryname", nil]; 
    [Flurry logEvent:@"SharedCatalogue" withParameters:flurrydicttionary3 timed:YES]; 
    [newArray addObject:newimage]; 

} 


NSMutableArray *addArray=[[NSMutableArray alloc]initWithArray:newArray]; 
[addArray addObjectsFromArray:newArraytext]; 


UIActivityViewController *activityViewController2 =[[UIActivityViewController alloc]initWithActivityItems:addArray applicationActivities:@[shopactivity]]; 

[self presentViewController:activityViewController2 animated:YES completion:^{}]; 

回答