鸣叫表ios5 presentModalViewController

时间:2012-01-19 09:43:32

标签: ios presentmodalviewcontroller tweets

我正在尝试整合来自twitter框架的推文表。我已经在我的iPad上工作但是当我在iPod上使用完全相同的代码时,我遇到了问题。

一切都很好,我可以打开推文表我可以输入推文但是当我想取消或发送推文按钮不起作用?

我还注意到我仍然可以触摸推文表后面的屏幕。有没有人知道如何设置推文表作为操作视图?我以为presentModalViewController做到了......

//Create the tweet sheet
TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init];

//Customize the tweet sheet here
//Add a tweet message
[tweetSheet setInitialText:@"text"];

//Add an image
NSString* path = [documentsDirectory stringByAppendingPathComponent: 
                  [NSString stringWithString: @"pngImage.png"] ];
UIImage* content = [UIImage imageWithContentsOfFile:path];

[tweetSheet addImage:content];


//Add a link
//Don't worry, Twitter will handle turning this into a t.co link
[tweetSheet addURL:[NSURL URLWithString:@"urlLink"]];


//Set a blocking handler for the tweet sheet
tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result){
    [self dismissModalViewControllerAnimated:YES];
};
//Show the tweet sheet!
[self presentModalViewController:tweetSheet animated:YES];

0 个答案:

没有答案