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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:50:27+00:00 2026-05-18T21:50:27+00:00

I’m working on a twitter app for the iphone using oAuth/MGTwitterEngine The source it’s

  • 0

I’m working on a twitter app for the iphone using oAuth/MGTwitterEngine
The source it’s based of is here: http://icodeblog.com/wp-content/uploads/2010/09/iCodeOauth.zip

But I want the user of the app to be able to go back and change the username and password if for an example the user has more than one twitter account.

Is it possible to give a button an action to open up the page that opens automatically the first time the app is opened. (The sign in page)

  • 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-18T21:50:27+00:00Added an answer on May 18, 2026 at 9:50 pm

    After digging into the code and playing with things I found a way to do this that is probably documented wherever you got the framework.

    Looking at iCodeOauthViewController.m, inside of viewDidAppear: you can call isAuthorized on the engine and it will tell you if you are authenticated or not. If this returns yes, you can then call the clearAccessToken method on the engine object to clear that authentication. When controllerToEnterCredentialsWithTwitterEngine: delegate: is next called it will return the view controller for re-entering the user name and password.

    edit:
    in iCodeOauthViewController.m inside fo viewDidAppear: (line 46) you will see this line:

    UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];
    

    this call returns the login screen that you see if the user is not yet logged in. If the user is logged in, it returns nil. If the controller is nil it jumps directly to the list.

    to “log out” a user you could use this method:

    - (void)switchUser
    {
        // log off the existing user if one is validated
        if ([_engine isAuthorized])
            [_engine clearAccessToken];
    
        // display the login prompt
        UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];       
        if (controller) 
            [self presentModalViewController: controller animated: YES];
    }
    

    edit 2:
    Looks like your problem is inside of your tweet method. You have added the alert code after the tweet attempts to send, and that results in a crash if the user isn’t logged in. Here is your code:

    -(IBAction)tweet:(id)sender {
    
        [textfield resignFirstResponder];
        [_engine sendUpdate:[textfield text]];
        [self updateStream:nil];
    
    
        if([_engine isAuthorized]==NO){UIAlertView *alert = [[UIAlertView alloc]
                                                             initWithTitle: @"Please, Sign in"
                                                             message: @"You'll have to sign in for this app to work!"
                                                             delegate: nil
                                                             cancelButtonTitle:@"Ok"
                                                             otherButtonTitles:nil];
            [alert show];
            [alert release];
            }
    }
    

    change it to look like this:

    -(IBAction)tweet:(id)sender {
    
    
    if([_engine isAuthorized]==NO){
        UIAlertView *alert = [[UIAlertView alloc]
                                                         initWithTitle: @"Please, Sign in"
                                                         message: @"You'll have to sign in for this app to work!"
                                                         delegate: nil
                                                         cancelButtonTitle:@"Ok"
                                                         otherButtonTitles:nil];
        [alert show];
        [alert release];
        }
    else {
        [textfield resignFirstResponder];
        [_engine sendUpdate:[textfield text]];
        [self updateStream:nil];
    
    }
    

    }

    Notice that we now check to see if we are authenticated before trying to send the tweet, and if we are not authorized then pop up an alert instead. My apologies, I may have misled you with the releasing the alert thing, I misunderstood what you were saying.

    I would recommend trying to understand a little more about how objective-c works and get familiar with the debugger. If you run the debugger and your app is crashing, the debugger will stop at the point in the code that is crashing, and you can look through the function calls in the stack to determine what the code is doing wrong. See this stack overflow question (specifically the answers) for more resources on how to get a better start with objective-c. I would recommend some of the online sites like CocoaDevCentral’s tutorials. Remember this. You’re off to a good start trying to make something your own based on an example. Don’t be afraid to make a side project to play around with an idea if it’s not immediately working out in your main project, even if it’s something as simple as figuring out another way to do 2 + 2. Hope that helps.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
We're building an app, our first using Rails 3, and we're having to build
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'm making a simple page using Google Maps API 3. My first. One marker
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,

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.