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 943399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:25:58+00:00 2026-05-15T22:25:58+00:00

i am creating a music application in iphone where i am integrating twitter in

  • 0

i am creating a music application in iphone where i am integrating twitter in my iphone so that a user can listen to a particular song click on the twitter tab ,log in to twitter and post his comment in to twitter.and i need that his username and password should be saved when he click on save username and password button so that he remain logged in when he is in the application.

I have done the code of saving username and password but i get an error indicating that “”FORMAT IS NOT A STRING LITERAL AND NO FORMAT ARGUMENTS””

Here is my code:

-(IBAction)SaveAll:(id)sender{


    UsernameString =[[NSString alloc]initWithFormat:text1.text]; "FORMAT IS NOT A STRING LITERAL AND NO FORMAT ARGUMENTS"

    [text1 setText:UsernameString];
    NSUserDefaults *UsernameDefault =[NSUserDefaults standardUserDefaults];
    [UsernameDefault setObject:UsernameString forKey:@"Stringkey"];



    PasswordString =[[NSString alloc]initWithFormat:text2.text]; "FORMAT IS NOT A STRING LITERAL AND NO FORMAT ARGUMENTS"

    [text2 setText:PasswordString];
    NSUserDefaults *PasswordDefault =[NSUserDefaults standardUserDefaults];
    [PasswordDefault setObject:PasswordString forKey:@"Stringkey2"];

}

Please help me in solving this problem so that when i click on the username and password button my username and password should be saved.

  • 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-05-15T22:25:58+00:00Added an answer on May 15, 2026 at 10:25 pm

    Use InitWithFormat if you want to create a String that is composed by several components, like a string and an integer for example then you would do something like this

    NSString *myString = [NSString stringWithFormat:@"%@ costs %i"itemName, itemprice];
    

    itemName would be an NSString Object, itemprice would be an integer.

    in your case, try doing it the following way:

    UsernameString =[[NSString alloc]initWithString:text1.text];
    

    or even easier

    UsernameString = text1.text;
    

    note:
    I would NOT recommend to store Passwords or any other sensitive information into userdefaults
    a better (more safe/secure way) to store passwords is to use the devices keychain, where stored information is heavily encrypted and access happens in a safe way.

    also it’s easy to use:

    Simple iPhone Tutorial: Password Management using the keychain by using SFHFKeychainUtils

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a music player application and it need that 2 actions to
I'm creating a music sharing site, so each user can set up his account,
I'm creating video music search in android WebView and I wanted users can launch
i am creating a music application and i want to integrate facebook into my
I am creating a little JavaScript music player that sits on the btottom of
I am creating a tutorial site for music producers. On each tutorial (post, that
I am creating a music application where I am using two uiviews in my
I am creating a music application in which I am adding a scrollview to
I got in to strange problem with the flow of application.I am creating music
I am creating an Android application which will have some embedded music inside of

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.