相关疑难解决方法(0)

使用TWrequest在IOS5中将带有文本的图像发送到Twitter

根据苹果示例,我可以使用TWRequest轻松发送推文,

 ACAccountStore *account = [[ACAccountStore alloc] init];
 ACAccountType *accountType = [accountaccountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

// Request access from the user to access their Twitter account
[account requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) 
 {
     // Did user allow us access?
     if (granted == YES)
     {
         // Populate array with all available Twitter accounts
         NSArray *arrayOfAccounts = [account accountsWithAccountType:accountType];

         // Sanity check
         if ([arrayOfAccounts count] > 0) 
         {
             // Keep it simple, use the first account available
             ACAccount *acct = [arrayOfAccounts objectAtIndex:0];

             // Build a twitter …
Run Code Online (Sandbox Code Playgroud)

twitter ios5

8
推荐指数
1
解决办法
4261
查看次数

标签 统计

ios5 ×1

twitter ×1