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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:57:00+00:00 2026-05-28T22:57:00+00:00

I’m using the RestKit iOS package to allow a user to pull info from

  • 0

I’m using the RestKit iOS package to allow a user to pull info from an account they have. The code below works perfectly the first time through. However, if I attempt to use a different username and password a second time, it just loads the information from the first mapping call. Furthermore, when the request is sent the second time, it returns the data unreasonably quickly which leads me to believe it is just using cached data. I’ve searched high and low for any way to reset restkit (and its cache) and none of them have worked. Here’s my code:

- (void)login {
    RKObjectMapping* mapping = [RKObjectMapping mappingForClass:[MyClass class]];
    [mapping mapKeyPathsToAttributes:
     @"Data.MailboxId", @"MailboxId",
     @"Data.value1", @"Value1",
     @"Data.value2", @"Value2",
     nil];


    [RKObjectManager objectManagerWithBaseURL:@"https://my.site.com"];

    [RKObjectManager sharedManager].client.username = username.text;
    [RKObjectManager sharedManager].client.password = password.text;

    [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/api/v1.0/?format=json" objectMapping:mapping delegate:self];
}

And here’s my log from RestKit:

2012-01-30 11:59:40.413 HostedNumbers[6909:707] D restkit.network:RKClient.m:265 Reachability observer changed for client <RKClient: 0x6f09640>, suspending queue <RKRequestQueue: 0x6f0a5d0 name=(null) suspended=YES requestCount=0 loadingCount=0/5> until reachability to host '0.0.0.0' can be determined
2012-01-30 11:59:40.425 HostedNumbers[6909:707] D restkit.network:RKClient.m:389 Reachability to host '0.0.0.0' determined for client <RKClient: 0x6f09640>, unsuspending queue <RKRequestQueue: 0x6f0a5d0 name=(null) suspended=YES requestCount=1 loadingCount=0/5>
2012-01-30 11:59:40.436 HostedNumbers[6909:707] D restkit.network:RKRequest.m:362 Sending asynchronous GET request to URL https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json.
2012-01-30 11:59:40.445 HostedNumbers[6909:707] T restkit.network:RKRequest.m:310 Prepared GET URLRequest '<NSMutableURLRequest https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json>'. HTTP Headers: {
    Accept = "application/json";
    "Content-Length" = 0;
}. HTTP Body: .
2012-01-30 11:59:43.045 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 11:59:43.513 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodHTTPDigest
2012-01-30 11:59:43.516 HostedNumbers[6909:707] D restkit.network:RKResponse.m:137 Received authentication challenge
2012-01-30 11:59:44.066 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 11:59:45.914 HostedNumbers[6909:707] D restkit.network:RKResponse.m:196 NSHTTPURLResponse Status Code: 200
2012-01-30 11:59:45.917 HostedNumbers[6909:707] D restkit.network:RKResponse.m:197 Headers: {
    "Cache-Control" = "no-cache";
    "Content-Length" = 2733;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Mon, 30 Jan 2012 16:59:46 GMT";
    Expires = "-1";
    Pragma = "no-cache, no-cache";
    Server = "Microsoft-IIS/6.0";
    "X-AspNet-Version" = "2.0.50727";
    "X-Powered-By" = "ASP.NET";
}
2012-01-30 11:59:45.923 HostedNumbers[6909:707] T restkit.network:RKResponse.m:202 Read response body: {"Data":[{"MailboxId":"SP6s2m5zgwze47lsN5bBew2","PhoneNumberList":[{"PhoneNumber":"1-877-564-7397","Description":"(877) 564-7397","Provisioned":true,"PhoneNumberId":"F5MOV_sc3-f9xWcAOCC1Tg2"}],"PhoneNumber":"1-877-564-7397","Prefix":795,"Extension":4920,"ProductId":"_iFmgCPNtTuU1PlknnSqXQ2","ProductCode":"SAR","ProductDescription":"PATLive Messaging Executive","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"hTw_mObs0ARWkbHxRXZyEw2","FeatureGroupDescription":"Hosted Voicemail/Fax","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/SAR.jpg","ServiceName":"Hosted Voicemail/Fax","MailboxName":"Connor Grady 1","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":4,"SavedMessages":2,"NewVoiceMessages":2,"SavedVoiceMessages":2,"NewFaxMessages":2,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0},{"MailboxId":"vEqAb2JRNLrP1lB51FVkEw2","PhoneNumberList":[{"PhoneNumber":"1-850-523-3762","Description":"(850) 523-3762","Provisioned":true,"PhoneNumberId":"T-Ykotn8UNweSr4O0jHiqw2"},{"PhoneNumber":"1-888-330-3948","Description":"(888) 330-3948","Provisioned":true,"PhoneNumberId":"KK41mHIFEo5jD9DrzG8_Ig2"},{"PhoneNumber":"1-888-682-8469","Description":"(888) 682-8469","Provisioned":true,"PhoneNumberId":"svD01yJqBrZuJK-HzKvpcQ2"},{"PhoneNumber":"1-888-826-2674","Description":"(888) 826-2674","Provisioned":true,"PhoneNumberId":"zUfxFyXxKXtHB9nMdCs5lg2"},{"PhoneNumber":"1-888-853-4264","Description":"(888) 853-4264","Provisioned":true,"PhoneNumberId":"vmMwo_7x2hYxKa4gAc0PpQ2"},{"PhoneNumber":"1-888-856-2307","Description":"(888) 856-2307","Provisioned":true,"PhoneNumberId":"ViDGc7pJW25kkimk-ObguA2"},{"PhoneNumber":"1-888-856-2742","Description":"(888) 856-2742","Provisioned":true,"PhoneNumberId":"Wpt7fnGXoz8RxcP-xZkl9g2"},{"PhoneNumber":"1-888-858-8276","Description":"(888) 858-8276","Provisioned":true,"PhoneNumberId":"hB-cyJHU-w4BcCVcXmcIsw2"}],"PhoneNumber":"1-850-523-3762","Prefix":795,"Extension":4613,"ProductId":"mLVv-rU2-6GRboN46onbOg2","ProductCode":"CTS","ProductDescription":"Call Tracker Service","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"v1uO_bCjMNSP9mF90AlO4w2","FeatureGroupDescription":"Hosted Local","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/CTS.jpg","ServiceName":"Hosted Local","MailboxName":"Connor Grady 2","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":0,"SavedMessages":0,"NewVoiceMessages":0,"SavedVoiceMessages":0,"NewFaxMessages":0,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0}],"ErrorCode":0,"ErrorMessage":"","DataInfo":{"TotalResults":2,"TotalPages":1,"CurrentPage":1,"ResultsPerPage":20}}
2012-01-30 11:59:45.956 HostedNumbers[6909:5e0f] D restkit.network:RKObjectLoader.m:210 Found directly configured object mapping, creating temporary mapping provider for keyPath '%@'

–My sign out happens here, the following is my second request with a username and password that should normally return with an authentication challenge–

2012-01-30 11:59:57.678 HostedNumbers[6909:707] D restkit.network:RKClient.m:265 Reachability observer changed for client <RKClient: 0x6f14400>, suspending queue <RKRequestQueue: 0x6f145b0 name=(null) suspended=YES requestCount=0 loadingCount=0/5> until reachability to host '0.0.0.0' can be determined
2012-01-30 11:59:57.687 HostedNumbers[6909:707] D restkit.network:RKRequest.m:362 Sending asynchronous GET request to URL https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json.
2012-01-30 11:59:57.691 HostedNumbers[6909:707] T restkit.network:RKRequest.m:310 Prepared GET URLRequest '<NSMutableURLRequest https://my.hostednumbers.com/api/v1.0/Mailbox/?format=json>'. HTTP Headers: {
    Accept = "application/json";
    "Content-Length" = 0;
}. HTTP Body: .
2012-01-30 11:59:57.698 HostedNumbers[6909:707] D restkit.network:RKClient.m:250 Reachability observer changed for RKClient <RKClient: 0x6f14400>, disposing of previous instance: <RKReachabilityObserver: 0x6f15cc0 host=0.0.0.0 isReachabilityDetermined=NO isMonitoringLocalWiFi=565500 reachabilityFlags=-- ------->
2012-01-30 12:00:00.012 HostedNumbers[6909:707] D restkit.network:RKResponse.m:163 Asked if canAuthenticateAgainstProtectionSpace: with authenticationMethod = NSURLAuthenticationMethodServerTrust
2012-01-30 12:00:02.076 HostedNumbers[6909:707] D restkit.network:RKResponse.m:196 NSHTTPURLResponse Status Code: 200
2012-01-30 12:00:02.082 HostedNumbers[6909:707] D restkit.network:RKResponse.m:197 Headers: {
    "Cache-Control" = "no-cache";
    "Content-Length" = 2733;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Mon, 30 Jan 2012 17:00:02 GMT";
    Expires = "-1";
    Pragma = "no-cache, no-cache";
    Server = "Microsoft-IIS/6.0";
    "X-AspNet-Version" = "2.0.50727";
    "X-Powered-By" = "ASP.NET";
}
2012-01-30 12:00:02.087 HostedNumbers[6909:707] T restkit.network:RKResponse.m:202 Read response body: {"Data":[{"MailboxId":"SP6s2m5zgwze47lsN5bBew2","PhoneNumberList":[{"PhoneNumber":"1-877-564-7397","Description":"(877) 564-7397","Provisioned":true,"PhoneNumberId":"F5MOV_sc3-f9xWcAOCC1Tg2"}],"PhoneNumber":"1-877-564-7397","Prefix":795,"Extension":4920,"ProductId":"_iFmgCPNtTuU1PlknnSqXQ2","ProductCode":"SAR","ProductDescription":"PATLive Messaging Executive","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"hTw_mObs0ARWkbHxRXZyEw2","FeatureGroupDescription":"Hosted Voicemail/Fax","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/SAR.jpg","ServiceName":"Hosted Voicemail/Fax","MailboxName":"Connor Grady 1","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":4,"SavedMessages":2,"NewVoiceMessages":2,"SavedVoiceMessages":2,"NewFaxMessages":2,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0},{"MailboxId":"vEqAb2JRNLrP1lB51FVkEw2","PhoneNumberList":[{"PhoneNumber":"1-850-523-3762","Description":"(850) 523-3762","Provisioned":true,"PhoneNumberId":"T-Ykotn8UNweSr4O0jHiqw2"},{"PhoneNumber":"1-888-330-3948","Description":"(888) 330-3948","Provisioned":true,"PhoneNumberId":"KK41mHIFEo5jD9DrzG8_Ig2"},{"PhoneNumber":"1-888-682-8469","Description":"(888) 682-8469","Provisioned":true,"PhoneNumberId":"svD01yJqBrZuJK-HzKvpcQ2"},{"PhoneNumber":"1-888-826-2674","Description":"(888) 826-2674","Provisioned":true,"PhoneNumberId":"zUfxFyXxKXtHB9nMdCs5lg2"},{"PhoneNumber":"1-888-853-4264","Description":"(888) 853-4264","Provisioned":true,"PhoneNumberId":"vmMwo_7x2hYxKa4gAc0PpQ2"},{"PhoneNumber":"1-888-856-2307","Description":"(888) 856-2307","Provisioned":true,"PhoneNumberId":"ViDGc7pJW25kkimk-ObguA2"},{"PhoneNumber":"1-888-856-2742","Description":"(888) 856-2742","Provisioned":true,"PhoneNumberId":"Wpt7fnGXoz8RxcP-xZkl9g2"},{"PhoneNumber":"1-888-858-8276","Description":"(888) 858-8276","Provisioned":true,"PhoneNumberId":"hB-cyJHU-w4BcCVcXmcIsw2"}],"PhoneNumber":"1-850-523-3762","Prefix":795,"Extension":4613,"ProductId":"mLVv-rU2-6GRboN46onbOg2","ProductCode":"CTS","ProductDescription":"Call Tracker Service","MailboxStatus":1,"BillingStatus":0,"MainMailbox":false,"InfoCode":0,"AliasId":"","FeatureGroupId":"v1uO_bCjMNSP9mF90AlO4w2","FeatureGroupDescription":"Hosted Local","FeatureGroupIcon":"https://my.hostednumbers.com/images/services/CTS.jpg","ServiceName":"Hosted Local","MailboxName":"Connor Grady 2","DID":true,"ExtensionDigits":0,"ParentMailboxId":"","NewMessages":0,"SavedMessages":0,"NewVoiceMessages":0,"SavedVoiceMessages":0,"NewFaxMessages":0,"SavedFaxMessages":0,"NewRecordings":0,"SavedRecordings":0}],"ErrorCode":0,"ErrorMessage":"","DataInfo":{"TotalResults":2,"TotalPages":1,"CurrentPage":1,"ResultsPerPage":20}}
2012-01-30 12:00:02.115 HostedNumbers[6909:3833] D restkit.network:RKObjectLoader.m:210 Found directly configured object mapping, creating temporary mapping provider for keyPath '%@'
  • 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-28T22:57:00+00:00Added an answer on May 28, 2026 at 10:57 pm

    The answer was surprisingly simple. I just added the following line of code to my request to force basic HTTP authentication and it all works:

    [RKObjectManager sharedManager].client.authenticationType = RKRequestAuthenticationTypeHTTPBasic;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.