应用程序崩溃Tweet按钮单击给出SIGKILL错误

时间:2012-01-02 09:18:04

标签: iphone objective-c ios5 tweets

我正在使用Twitter Oath进行推特分享,当我点按Tweet按钮时突然发生同样的代码崩溃。

当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;

}

1 个答案:

答案 0 :(得分:0)

如果您在iOS 5上进行多次测试,它甚至不会正确生成令牌。您使用的Twitter引擎仅适用于iOS4。

现在来到你的代码,因为没有生成令牌,没有它,你将尝试发布消息,因此它崩溃了。过去一个月我做了很多研究,我决定以这种方式实施: 如果是运行应用程序的iOS 5设备,请使用twitter框架。否则使用MGTwitterEngine。

查找以下网址< s 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

相关问题