0

我无法在 Twitter 上发送状态更新。

这是我的代码..

- (void) tweet{

_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
_engine.consumerKey = @"someKey";
_engine.consumerSecret = @"someSecret";

UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];

if (controller)
    [self presentModalViewController: controller animated: YES];
else {
    tweets = [[NSMutableArray alloc] init];
    [self updateStream:nil];
}

[_engine sendUpdate:@"test"];
[self updateStream:nil];

}

4

1 回答 1

2

尝试以这种方式使用:

- (void) tweet{


_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
_engine.consumerKey = @"someKey"; //So please make sure that you had replaced the keys over here.
_engine.consumerSecret = @"someSecret";

UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];

if (controller)
    [self presentModalViewController: controller animated: YES];
else {
    tweets = [[NSMutableArray alloc] init];
   [_engine sendUpdate:[NSString stringwithFormat:@"Today Test Date is %@",[NSDate date]]]; // You will be able to post any tweet when you are successfully logged in.So post the message after login rather than 
   [self updateStream:nil];
}
}

我相信它会为你工作....

于 2011-06-05T05:37:52.007 回答