0
我收到嘗試使用下面的代碼發佈到Twitter的圖像時這個錯誤,不能認爲我是什麼如何解決錯誤的想法?警告:試圖提出<SLTwitterComposeViewController:0x233141c0>在<MainController:0x2083ebb0>誰的觀點是不是在窗口層次
- (void)PostToTwitter
{
UIImage* pxImage = [[self GetResultImage] retain];
TWTweetComposeViewController *twitter = [[[TWTweetComposeViewController alloc] init] autorelease];
[twitter setInitialText:@"Twitter Pic"];
[twitter addImage:pxImage];
FaceAppDelegate* app = (FaceAppDelegate*)[[UIApplication sharedApplication] delegate];
[app.mainCtrl presentViewController:twitter animated:YES completion:NULL];
twitter.completionHandler = ^(TWTweetComposeViewControllerResult res)
{
if(res == TWTweetComposeViewControllerResultDone)
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" message:@"You have posted successfully." delegate:self cancelButtonTitle:@"Close" otherButtonTitles: nil];
[alert show];
[alert release];
}
else if(res == TWTweetComposeViewControllerResultCancelled)
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Cancelled" message:@"You have cancelled posting to Twitter." delegate:NULL cancelButtonTitle:@"Close" otherButtonTitles: nil];
[alert show];
[alert release];
}
[app.mainCtrl dismissModalViewControllerAnimated:YES];
};
[pxImage release];
}
我那個'app.mainCtrl'視圖控制器是不是在你努力表現Twitter的控制器時顯示。 – rmaddy
@rmaddy,加上一個好的答案,雖然在註釋的形式。 –