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

  • Home
  • SEARCH
  • 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 7872763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:18:27+00:00 2026-06-03T02:18:27+00:00

I am trying to set the initial text for what the twitter message should

  • 0

I am trying to set the initial text for what the twitter message should say in my app using a NSString from my appDelegate. Check out the code here:

    NSString *tweet;
tweet=[MyWebFunction tweet:appDelegate.stadium_id];


if([deviceType hasPrefix:@"5."]){

    // Create the view controller
    TWTweetComposeViewController *twitter = [[TWTweetComposeViewController alloc] init];

    [twitter setInitialText:@"@%",tweet];

The problem is, is there is an error at the twitter setInitialText that there are Too many arguments to method call, expected 1, have 2. ?!?!?

Any help is greatly appreciated. 🙂

Screenshot

  • 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-03T02:18:30+00:00Added an answer on June 3, 2026 at 2:18 am

    The TWTweetComposeViewController method setInitialText only takes one argument, being of type NSString*. You cannot simply format any and all NSString variables passed to a method as you can with the NSString method stringWithFormat (which is, I imagine, where you’ve seen the syntax [NSString stringWithFormat:@"%@", myString]).

    In your case, you either need to simply call:

    [twitter setInitialText:tweet];
    

    or call:

    [twitter setInitialText:[NSString stringWithFormat:@"%@", tweet]]
    

    EDIT
    I feel it necessary to add, to further your understanding, that a method only takes a variable number of arguments (such as stringWithFormat) when its declaration ends with ...

    For example, looking in the docs for NSString reveals that stringWithFormat is declared as such:

    +(id) stringWithFormat:(NSString *)format, ...;
    

    Similarly, arrayWithObjects in NSArray is declared as such:

    +(id) arrayWithObjects:(id)firstObj, ...;
    

    which one would use like:

    NSString* myString1 = @"foo";
    NSString* myString2 = @"bar";
    NSNumber* myNumber = [NSNumber numberWithInt:42];
    NSArray* myArray = [NSArray arrayWithObjects:myString1, myString2, myNumber, nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to set the initial values for a list box using asp.net
I'm trying to figure out how to set the input value of a text
I'm trying to set an initial value in my jquery ui datepicker. I've tried
I'm trying to set the initial value of a input field. In the template,
Trying to set up Cancan within an app of mine and having trouble with
Currently I'm trying to set up a Form to create a News-Item from. The
I'm trying to add a set of poly lines to a google map from
I'm trying to set the initial visiblity of some dygraphs data series by column
I am trying to set the initial focus to a control in a Silverlight
I am trying to integrate twitter framework into my app to give the users

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.