我正在使用 Twitter Oath 进行 Twitter 共享,当我点击 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];
}
}
此代码用于推文!(应用程序崩溃的地方)。
-(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;
}