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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:44:03+00:00 2026-06-09T03:44:03+00:00

When logging a user into my application I need to pull a user object

  • 0

When logging a user into my application I need to pull a user object down from the server using only the username. This returns the userId (among other things) that I need in order to make other API calls. From that point I’ll make a couple other HTTP calls using the userId. How can I make a synchronous call to completely pull down the user object before sending the other calls?

I’ve setup my object mapping in my app delegate class, which works perfectly, and am using this code to pull the user object down from the server:

[[RKObjectManager sharedManager] loadObjectsAtResourcePath:[@"/api/users/" stringByAppendingString:[_userNameField text]] delegate:self];

This is what I’ve tried… as suggested here: Making synchronous calls with RestKit

RKObjectLoader* loader = [[RKObjectManager sharedManager] objectLoaderForObject:currentUser method:RKRequestMethodPUT delegate:nil];
RKResponse* response = [loader sendSynchronously];

However this code (1) uses the deprecated method objectLoaderForObject and (2) crashes saying 'Unable to find a routable path for object of type '(null)' for HTTP Method 'POST''.

  • 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-09T03:44:07+00:00Added an answer on June 9, 2026 at 3:44 am

    Putting aside the question of whether this is the ideal design for an iPhone application, I was able to accomplish what I was hoping using blocks.

    [[RKObjectManager sharedManager] loadObjectsAtResourcePath:[@"/api/users/" stringByAppendingString:[_userNameField text]] usingBlock:^(RKObjectLoader* loader) {
    
        loader.onDidLoadResponse = ^(RKResponse *response) {
    
            NSLog(@"Response: \n%@", [response bodyAsString]);
        };
    
        loader.onDidLoadObjects = ^(NSArray *objects) {
    
            APIUser *apiUser = [objects objectAtIndex:0];
            NSLog(@"user_id is %i", apiUser.user_id);
    
    
        };
    
        loader.onDidFailWithError = ^(NSError *error) {
    
    
                UIAlertView *badLoginAlert = [[UIAlertView alloc]initWithTitle:NSLocalizedString(@"LOGIN_FAILED", nil)
                                                                       message:NSLocalizedString(@"BAD PASSWORD OR USERNAME", nil)
                                                                      delegate:self
                                                             cancelButtonTitle:NSLocalizedString(@"OK", nil)
                                                             otherButtonTitles:nil];
                [badLoginAlert show];           
        };
    }];
    

    Hope this helps someone.

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

Sidebar

Related Questions

Here's the scenario: if this is a user's first time logging into my web
I am fetching username from database when a user is logging in by his
I'm using the server side authentication flow to handle logging into my C# .NET
Something like this: if self.__class__ == User: logging.debug(%s non_pks were found % (str(len(non_pks))) )
I'm creating a website and I'd like to prevent the user from logging in
I'm building UI logging into a long-existing ASP.NET enterprise application. I have my own
I'm looking to build into an application some custom logging information to use later
This is a Spring Security question. In my application, I have a User entity
I'm building a C# application using .NET 3.5 that will require logging in to
For testing purposes, I want to use a DialogBox for logging into 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.