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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:13:09+00:00 2026-05-23T12:13:09+00:00

I want to keep password which is given by user in a variable. Where

  • 0

I want to keep password which is given by user in a variable. Where to get password value. I look in code but it is containing only username. I am using MGTwitterengine api in my application. Here is the function which is printing data on console.

-(void)setUsername:(NSString *)newUsername password:(NSString *)newPassword
{
     NSLog(@"uset sername %@ and password %@",newUsername,newPassword);
     ...
}

I debug in all function but I saw this function is running after loggedin. But this is printing null in password value although username is printing well. Actually I I have to trace all tweet value of user. I went through MGTwitterEngine. There is a block of code but it is necessary to write username and password.

Here is the code

MGTwitterEngine *twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self]; 

[twitterEngine setUsername:@"username" password:@"password"]; 
// Get updates from people the authenticated user follows. 

NSString *connectionID = [twitterEngine getFollowedTimelineFor:nil since:nil startingAtPage:0];

Please help me how to keep password ?

  • 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-23T12:13:10+00:00Added an answer on May 23, 2026 at 12:13 pm

    Read the developer documentation, it provides all the info you need for something as easy as this. Back to the question, there’re a couple of ways how you can save this data.

    NSUserDefaults: You can save the username and password using this class like this:

    [[NSUserDefaults sharedUserDefaults] setObject:username forKey:@"username"];
    [[NSUserDefaults sharedUserDefaults] setObject:username forKey:@"password"];
    [[NSUserDefaults sharedUserDefaults] synchronize];
    

    Once you need this data again, call it:

    NSString*username = [[NSUserDefaults standardUserDefaults] objectForKey:@"username"];
    NSString*password = [[NSUserDefaults standardUserDefaults] objectForKey:@"password"];
    

    OR:

    NSDictionary: If you don’t want to rely on NSUserDefaults, you can save the login data in a NSDictionary and save it to your sandbox. This works like this:

    NSMutableDictionary*loginDictionary = [[NSMutableDictionary alloc] init];
    [loginDictionary setObject:username forKey:@"username"];
    [loginDictionary setObject:password forKey:@"password"];
    [loginDictionary writeToFile://Your Path Here atomically:NO];
    
    [loginDictionary release];
    

    Then, once you need the data again, read from file:

    NSMutableDictionary*loginDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile://Your Path];
    
    NSString*username = [loginDictionary objectForKey:@"username"];
    NSString*password = [loginDictionary objectForKey:@"password"];
    
    [loginDictionary release];
    

    Hope it helps!

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

Sidebar

Related Questions

I want to include validates_confirmation_of :password in a module but i keep getting errors
I want to keep viewstate of a specific page in session but following code
I want to keep only numbers and remove all characters from a variable. For
I want to keep a cell selected, and only change when I select another
I want to add code to my iOS app which prompts users to follow
I want to keep login status with cookie in Codeigniter, but I can't set
I want to keep logs of some things that people do in my app,
I want to keep my website/s in version control (Subversion specifically) and use svn
I want to keep the class simple and not defined a constructor so i
I want to keep tabs on the number of concurrent users of my application.

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.