Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Since there is no accepted answer yet: using multiple object managers is quite simple using <code>RestKit</code>.</p> <p>From the <a href="https://github.com/RestKit/RestKit/wiki/">Wiki</a> (<a href="https://github.com/RestKit/RestKit/wiki/Using-Multiple-Base-URLs-%28and-Multiple-Object-Managers%29">Using Multiple Base URLs (and Multiple Object Managers</a>):</p> <blockquote> <p>The first object manager you create will be the shared singleton RestKit uses by default. But by creating additional object managers, you can pull from their BaseURLs as needed, just be sure to retain these new managers.</p> </blockquote> <pre><code>RKObjectManager *flickrManager = [RKObjectManager objectManagerWithBaseURL:flickrBaseUrl]; // &lt;-- shared singleton RKObjectManager *foursquareManager = [[RKObjectManager objectManagerWithBaseURL:foursquareBaseUrl] retain]; // &lt;-- you must retain every other instance. </code></pre> <blockquote> <p>Depending on your application, you may want to put this second object manager in a more accessible place, like a retained property on the AppDelegate, so that it's easy to pull from as needed. In the event that you need to differentiate between the results from your two (or more) object managers, simply set an identifier in the userData for the queries.</p> </blockquote> <pre><code>- (void)someAction(id)sender { // ....... RKObjectLoader* loader = [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/whatever" delegate:self]; loader.userData = @"foursquare"; // or do this, if you need a number instead of a string loader.userData = [NSNumber numberWithInt:1234]; // ....... } //Then when the delegate comes back you can cast it into a string or number as appropriate: - (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects { // ....... NSString* source = (NSString*) objectLoader.userData; // or, if you did the NSNumber instead: NSNumber* source = (NSNumber*) objectLoader.userData; // ....... } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload