MGTwitterEngine (iPhone) 不会向 Twitter 发送更新

发布于 2024-11-14 05:52:49 字数 594 浏览 0 评论 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];

}

I cant send status update on twitter.

Here is my code..

- (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];

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萝莉病 2024-11-21 05:52:49

尝试以这种方式使用:

- (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];
}
}

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

Try using in this way:

- (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];
}
}

I am sure it would work for you....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文