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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:07:45+00:00 2026-06-13T21:07:45+00:00

This question is about wrapping RestKit requests in custom objects, and whether or not

  • 0

This question is about wrapping RestKit requests in custom objects, and whether or not I can guarantee that an object sending the RestKit request will also be used as a delegate when the response is returned.

I’m working with an abstruse REST API (Salesforce), and RestKit doesn’t appear to handle some of Salesforce’s peculiarities well — for example, when you make a call to the Salesforce REST API, you might get back a partial dataset, and then be given a “nextRecordsUrl” that you must follow to get the next chunk. Others working with Salesforce and REST have run into the same issue (ref https://groups.google.com/forum/#!msg/restkit/HJNjB7I6WVM/8u5n7nHoJQUJ). I created a class to wrap the calls to Salesforce and automatically follow these links, and process the returned data sets correctly. The class instance registers itself as the delegate for the REST call.

The class I wrote works great on its own (when there’s a single instance), but I’ll be creating other classes and have several instances that will need to handle their data independently. I’ve read through the documentation and code (it’s been a learning experience, I’ve only worked with ios for about a month now), but I can’t see if it’s guaranteed that a particular instance will respond as the delegate for its requests alone, or if it might accidentally pick up the responses for another instance.

For example, suppose I have instances A and B, both of which are making requests using RKObjectLoader, and which set themselves as delegates using loader.delegate = self;. Both are running simultaneously (asynchronous). Here’s a potential flow I see:

  1. A’s RKObjectLoader makes call, registers self as delegate for response
  2. RestKit framework sends request for A
  3. B’s RKObjectLoader makes call, registers self as delegate for response
  4. RestKit framework sends request for B
  5. … wait …
  6. RestKit framework gets response, and somehow determines that this response was from B’s request, calling B as the delegate
  7. B delegate methods get called
  8. RestKit framework gets response, and somehow determines that this response was from A’s request, calling A as the delegate
  9. A delegate methods get called

I couldn’t see how the RestKit framework would distinguish between responses from requests, and thereby ensure that the correct delegate instances get called. In other words, it appears to me that RestKit might get a response to a request, and then call any delegate it wants … but that seems counterintuitive, and the framework author appears to be very sharp.

So, my questions:

  1. If I have a class instance using RKObjectLoader and setting itself as the delegate, can I be guaranteed that it will be called when the response for that request comes in?
  2. Can you point me to the actual implementation in the RestKit framework that handles this, so I can learn how it’s done?

Thanks very much!

  • 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-13T21:07:47+00:00Added an answer on June 13, 2026 at 9:07 pm

    I haven’t received an answer to this question, but in case somebody has the same question and comes across this, here’s the answer: yes, RestKit does appear to match the correct delegate with the outgoing request.

    I created a small class (with an (NSString*) identifier property that calls a service, and in the delegates I printed out the instance’s identifier with the result. I confirmed that instance A’s delegate method was handling instance A’s call, and B’s was handling B’s, with several simultaneous calls.

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

Sidebar

Related Questions

I've this question about pass some instances by ref or not: here is my
I asked a question about different testing frameworks yesterday. This question can be found
(Edited) NOTE: this question is NOT about how Eclipse's code formatter wrap long String
This is not a question about real code, it is just for discussion. It
This is issue about LANGUAGE DESIGN. Please do not answer to the question until
What This Question Is Not About This question is not about how to auto-close
This question about Timers for windows services got me thinking: Say I have (and
Followed this question about delayed_job and monit Its working on my development machine. But
Note: I originally asked this question about an hour ago but only recently realized
I have seen this question about deploying to WebSphere using the WAS ant tasks.

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.