Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8737289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:29:15+00:00 2026-06-13T10:29:15+00:00

I’m trying to share using Twitter Framework on iOS 5 The user will select

  • 0

I’m trying to share using Twitter Framework on iOS 5
The user will select which account to use, so the app will share using the account selected.

But whem share pass to performRequestWithHandler nothing happen an the error return null

My code:

for (int i = 0; i < [_accountsArray count]; i++) {
//searching for a selected account
            if ([[[_accountsArray objectAtIndex:i] username] isEqualToString:[self getUserName]]) {
                actualUser = [_accountsArray objectAtIndex:i];
                TWRequest *sendTweet = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"https://upload.twitter.com/1/statuses/update_with_media.json"]
                                                            parameters:nil
                                                        requestMethod:TWRequestMethodPOST];

                [sendTweet addMultiPartData:[text dataUsingEncoding:NSUTF8StringEncoding] withName:@"status" type:@"multipart/form-data"];
                ACAccountStore *account = [[ACAccountStore alloc] init];

                [sendTweet setAccount:[account.accounts objectAtIndex:i]];
                NSLog(@"%@",sendTweet.account);

                [sendTweet performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {

                    NSLog(@"responseData: %@\n",  responseData);
                    NSLog(@"urlResponse: %@\n", urlResponse);
                    NSLog(@"error: %@",error);

                }];
            }
        }

anyone can help me?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:29:16+00:00Added an answer on June 13, 2026 at 10:29 am

    Sending tweets in iOS is extremely easy now. Last night I updated my app to no longer use the old technique and instead use the new SLComposeViewController technique. Below is a snippet of code I have in my application that allows the user send a tweet with the attached image. Basically the exact same code can be used to post to facebook. Try using this code instead. It should also allow the user to choose what account they send the tweet from (I also believe this “default account” sending setting is buried in the settings of the phone someplace).

    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
            SLComposeViewController *mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
            [mySLComposerSheet setInitialText:@"Sample Tweet Text"];
    
            //Add the image the user is working with
            [mySLComposerSheet addImage:self.workingImage];
    
            //Add a URL if desired
            //[mySLComposerSheet addURL:[NSURL URLWithString:@"http://google.com"]];
    
            //Pop up the post to the user so they can edit and submit
            [self presentViewController:mySLComposerSheet animated:YES completion:nil];
    
            //Handle the event
            [mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
                switch (result) {
                    case SLComposeViewControllerResultCancelled:
                        NSLog(@"Tweet Canceled");
                    case SLComposeViewControllerResultDone:
                        NSLog(@"Tweet Done");
                        break;
                    default:
                        break;
                }
            }];
    
        } else {
            //Can't send tweets, show error
            NSLog(@"User doesn't have twitter setup");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to select an H1 element which is the second-child in its group
We're building an app, our first using Rails 3, and we're having to build
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am using Paperclip to handle profile photo uploads in my app. They upload
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.