在IOS上的twitter上分享图像

时间:2012-05-26 20:41:08

标签: ios twitter

我想通过我的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"];  
    }
}

1 个答案:

答案 0 :(得分:1)

您是否考虑过使用iOS 5的Twitter Framework?特别是,请查看TWTweetComposeViewController,这样可以轻松添加图片。