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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:57:21+00:00 2026-06-13T23:57:21+00:00

I’m trying to develop an application where it allows user logins with AFNetworking. I

  • 0

I’m trying to develop an application where it allows user logins with AFNetworking. I have the database set up correctly and everything seems to be working fine except when the user first logs on.

What I have is very simplistic:

[[API sharedInstance] commandWithParams:params
                               onCompletion:^(NSDictionary *json) {
                                   //result returned

                                   NSDictionary* res = [[json objectForKey:@"result"] objectAtIndex:0];

                                   if ([json objectForKey:@"error"]==nil && [[res objectForKey:@"UserID"] intValue]>0) {
                                       [[API sharedInstance] setUser: res];
                                       [self performSegueWithIdentifier:@"Login" sender:self];
                                   } else {
                                       //error
                                       [UIAlertView title:@"Error" withMessage:[json objectForKey:@"error"]];
                                   }

                               }];

Basically, the above code returns the result for a user login details, successful only if login details match. As you can see above, I clearly set the user in the sharedInstance, used throughout the application. After the user is set I attempt to perform the segue, as that’s what a login button should do.

The segue does occur and the program is operational, but there’s 2 issues I can’t work out and I’ve been spending hours trying to fix it. First I get the message in Xcode’s output window:

Warning: Attempt to present UITabBarController on LoginVC while a
presentation is in progress!

And secondly, to test that the user was set correct, on the Profile screen (the first screen segued to) have a label that has it’s text set to:

NSString stringWithFormat:@"Welcome %@",[[[API sharedInstance] user] objectForKey:@"username"]];

And it’s a hit or miss whether the username actually appears or says (null) as shown:

enter image description here

You can also see a button I made there, to print to the output window the values of user. Even when the message is “Welcome (null)” and I press the button, all the values are correctly there so I’m unsure why the string sometimes states null.

Here’s the storyboard setup regarding the issue I’m having:

enter image description here

If anyone could help me on this one I would truly appreciate it.

  • 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-13T23:57:23+00:00Added an answer on June 13, 2026 at 11:57 pm

    As you correctly diagnosed, the problem is definitely some strange and/or duplicative invocation of the segues. Looking at your project, the problem is that your “Login” button has both an IBAction method as well as a segue from that login screen to the next controller (the tab bar controller):

    both IBAction and segue

    That’s a problem, because the segue will be triggered when you hit the button, but will be triggered again by your - (IBAction)login:(id)sender code.

    Because you have an IBAction, the segue should not be from the button to the next controller, but rather from the controller itself. Thus, delete your existing Login segue from the button to the next screen and recreate it from the controller itself:

    create segue from controller to next scene

    Give that new segue the “Login” identifier, and now your “Login” button will not automatically perform the segue itself, but will let the IBAction do its work and manually performSegueWithIdentifier as appropriate.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.