0

嗨,我想通过我的 APP 在 Twitter 上分享图片。我通过以下代码成功推文。如何用文本推文图像。

-(IBAction)updateTwitter{

    if(!_engine){  
        _engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];  
        _engine.consumerKey    = kOAuthConsumerKey;  
        _engine.consumerSecret = kOAuthConsumerSecret;  
    }  
    if(![_engine isAuthorized]){

        UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];  
        if (controller){  
            [self presentModalViewController: controller animated: YES]; 
        }  
    } 

    if([_engine isAuthorized]){
        [_engine sendUpdate:@"This is my first test"];  
    }
}
4

1 回答 1

1

你考虑过使用 iOS 5 的Twitter 框架吗?特别是,查看TWTweetComposeViewController,它可以让您轻松添加图像。

于 2012-05-26T23:39:57.170 回答