2013-01-15 71 views
1

我有一個UIActivityViewController與3種不同類型的活動項目。UIActivityViewController:活動項目配置

NSString,UISimpleTextPrintFormatterUIImage

當我嘰嘰喳喳,Facebook或發送郵件系統總是添加字符串和圖像,但是當我打印系統使用UISimpleTextPrintFormatter,除非我從NSArray刪除它。我如何告訴UIActivityViewController使用UIImage進行打印?

NSString *textToShare 
= [NSString stringWithFormat:@"%@ %@ %i", 
    _car.make,_car.model, _car.constructionYear]; 

UISimpleTextPrintFormatter *textDataToShare 
= [[UISimpleTextPrintFormatter alloc] initWithText:textToShare]; 

UIImage* imageToShare = [UIImage imageNamed:_car.picture]; 

NSArray* items = @[textToShare,imageToShare,textDataToShare]; 

UIActivityViewController *activityViewController 
= [[UIActivityViewController alloc] 
    initWithActivityItems:items applicationActivities:nil]; 

回答