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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:10:21+00:00 2026-05-23T19:10:21+00:00

I am currently migrating a project that used ASIHTTPRequest and SBJson to RestKit. The

  • 0

I am currently migrating a project that used ASIHTTPRequest and SBJson to RestKit.

The previous implementation was using an NSOperation to make the HTTP Request, parse the JSON object and make the necessary calls to the Core Data API.

I have re-factored this as follows:

@implementation UpdateBeers

#pragma mark - NSOperation

- (void)main {
    [[RKClient sharedClient] get:@"/beers" delegate:self]; 
}

- (void)request:(RKRequest*)request didLoadResponse:(RKResponse*)response {  
    debug(@"didLoadResponse");
}  

- (void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error {
    debug(@"%@", error);
}

#pragma mark - Memory

- (void) dealloc {
    [super dealloc];
}

@end

The following appears in the log

sending GET request to URL http://localhost:9091/api/test. HTTP Body:

The problem is the server never receives the request.

Adding the following line :

[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.3]];

to the end of the main method solves this problem.

My question is :

Should I be executing ResKit API calls as an NSOperation and if not what are my alternatives for making calls in the background?

Thanks in advance.

  • 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-23T19:10:22+00:00Added an answer on May 23, 2026 at 7:10 pm

    Perhaps I’m not fully understanding the overall problem here … Just about everything RestKit does with respect to loading resources from the network is already in the background. Almost everything is already asynchronous, and thus running the existing asynchronous RestKit methods inside an NSOperation is duplicative and counter productive. That being said, once RestKit tells you that it’s finished downloading your data (didLoadResponse), you may want to do any subsequent post-processing in an NSOperation if that part is computationally intensive and unrelated to the UI. Otherwise, don’t try to outthink RestKit, just run it as in the examples and you’re good to go with asynchronous goodness.

    Moreover, you may want to look at using RestKit’s request queues if you plan to fire off several requests at the same time. It’ll still download everything asynchronously, but it’ll only run as many requests at a time as you tell it … when my app is updating, send of about seven requests at once, but the queue will run them serially instead of parallel, thus preventing any network bandwidth issues

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

Sidebar

Related Questions

I'm currently migrating a project that is using Spring MVC without annotations to Spring
I'm working on a project that is currently migrating from Apache Tomcat 6 to
I'm using (GNU) Make in my project. I'm currently putting one makefile per directory
I'm currently involved in a project that is migrating some old VB6 code to
I'm currently migrating my sqllite application to using core data. When I created the
I'am currently migrating an iphone application using SQLite to CoreData. I need to do
I'm currently migrating a project from JBoss 4.2.2 to JBoss 6.0.0 and I'm also
I have two projects that currently use SVN and I'm migrating to git, I
Currently, I am in the progress of migrating CVS to Mercurial. http://jstock.hg.sourceforge.net/hgweb/jstock/ I would
I'm currently migrating my project from PHP (codeigniter) to Rails3 and it's amazing. But

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.