iOS6:Twitter的SetInitialText不工作

iOS6:Twitter的SetInitialText不工作

问题描述:

我刚刚更新我的应用程序到iOS 6,和SetInitialText功能TWTweetComposeViewController已停止工作。作曲家只是空着。我正在使用MonoTouch,有没有其他人看到过这个问题?相同的代码在我的iOS 5设备上仍能正常工作。iOS6:Twitter的SetInitialText不工作

可正常工作,我用下面的代码:

var button2 = UIButton.FromType (UIButtonType.RoundedRect); 
button2.Frame = new RectangleF (0f, 0f, 300f, 40f); 
button2.SetTitle ("Tweet!", UIControlState.Normal); 
button2.TouchUpInside += (sender, e) => { 
    var tvc = new TWTweetComposeViewController(); 
    tvc.SetInitialText ("Here is a tweet..."); 
    tvc.SetCompletionHandler ((result) => { 
     if (result == TWTweetComposeViewControllerResult.Cancelled) { 
      Console.WriteLine ("Cancelled sending the tweet!"); 
     } else { 
      Console.WriteLine ("Tweet sent! hurrah!"); 
     } 
     this.DismissModalViewControllerAnimated (true); 
    }); 
    this.PresentModalViewController (tvc, true); 
}; 
View.AddSubview (button2); 

即使PresentModal和DismissModal已被弃用,你有问题的示例代码?

+0

谢谢你的例子,我通过直接实例化TWTweetComposeViewController而不是在新的视图控制器中实现它来解决问题。 – Zach

+0

随时将问题标记为已回答,以便其他人知道问题已成功回复:) – chrisntr