应用程序崩溃时,Tweet按钮点击SIGKILL错误
我使用Twitter誓言Twitter的共享,突然间,当我点击Tweet按钮时,相同的代码崩溃。应用程序崩溃时,Tweet按钮点击SIGKILL错误
应用程序在Twitter宣誓发送更新请求时崩溃。
这里是共享选项
-(IBAction)ShareWithTwitter:(id)sender
{
NSLog(@"Tweet !!!");
if(!_engine)
{
_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
_engine.consumerKey =kOAuthConsumerKey;
_engine.consumerSecret = kOAuthConsumerSecret;
}
else
{
_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
_engine.consumerKey =kOAuthConsumerKey;
_engine.consumerSecret = kOAuthConsumerSecret;
}
UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];
if (controller)
{
[self presentModalViewController: controller animated: YES];
}
}
的代码和这个代码是分享Tweet! (哪里的应用程序崩溃)。
-(IBAction)updateTwitter:(id)sender
{
activityIndicatorView.hidden=NO;
activityIndicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
[activityIndicatorView startAnimating];
[tweetTextField resignFirstResponder];
NSString *strToPostOnTwitter = @"Hello Happy New Year to All !!!";
NSLog(@"String to Post is : %@",strToPostOnTwitter);
//Twitter Integration Code Goes Here
[_engine sendUpdate:strToPostOnTwitter];
//btnTwitter.hidden = YES;
}
如果您在iOS 5上测试它很多次,它甚至不会正确生成令牌。您使用的Twitter引擎仅适用于iOS4。
现在来到您的代码,因为没有生成令牌,并且没有它,您将尝试发布消息并因此崩溃。过去一个月我做了很多研究,并决定采用这种方式: 如果您正在运行应用程序的iOS 5设备使用twitter框架。否则使用MGTwitterEngine。
查找以下网址的
http://iosdevelopertips.com/core-services/ios-5-twitter-framework-part-1.html
http://iosdevelopertips.com/core-services/ios-5-twitter-framework-part-2.html
http://iosdevelopertips.com/core-services/ios-5-twitter-framework-%E2%80%93-part-3.html
有没有教程或示例代码的Twitter框架? – NSException 2012-01-02 09:31:55
感谢您的链接,但第三个链接没有任何教程,让我试试其余的两个。再次感谢。 – NSException 2012-01-02 09:59:13
前两个链接就足够了。第三个只是供参考。 – Satyam 2012-01-02 10:21:40
嘿!你没有得到我的通知。? – mAc 2012-01-04 06:40:26
米没有得到! – NSException 2012-01-04 08:53:57
为我工作..... http://stackoverflow.com/questions/8576877/mgtwitterengine-crash-in-ios5 – 2012-01-24 12:48:53