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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:18:11+00:00 2026-06-17T01:18:11+00:00

In my iOS app I am hitting a web service when the app loads

  • 0

In my iOS app I am hitting a web service when the app loads to check for updates to various tables(entities) in my Core Data DB.

I do this in a background thread so the user can still interact with the app

The issue I am having is when I try to load a view that contains a table of entities that I access from Core Data– the app becomes unresponsive and lags until the background updating is complete.

Is it possible to have a lag-less experience if for example I touch to view my table of “Tasks” while in the background I am updating those “Tasks”?

I am using MagicalRecord and performing my creates/updates in a saveInBackgroundWithBlock block

 [MagicalRecord saveInBackgroundWithBlock:^(NSManagedObjectContext *localContext){      
        //UserTasks
        if([viewName isEqualToString:[[NSString stringWithFormat:@"UserTask_vw_iSales"] lowercaseString]])
        {
            //returns a UserTask or nil if one does not exist
            UserTask *oldUserTask = [UserTask doesExist:[record valueForKey:@"JSONData"]];

            if(oldUserTask)
            {
                NSLog(@"deleting old UserTask");

                [UserTask MR_deleteAllMatchingPredicate:[NSPredicate predicateWithFormat:@"userTaskUID == %@", oldUserTask.userTaskUID] inContext:localContext];
            }

            //create new one 
            UserTask *utt = [UserTask MR_createInContext:localContext];
            [utt initWithJSONSting:[record valueForKey:@"JSONData"]];

            NSLog(@"Creating UserTaskType: %@", utt.userTaskUID);
        }
 }]; 

Thanks for any help!

  • 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-17T01:18:13+00:00Added an answer on June 17, 2026 at 1:18 am

    I ended up not using MagicalRecord to get the behavior I was looking for– I followed this post:

    https://stackoverflow.com/a/11814957/480415

    Now my UI is not locked up while updating entities in the background.

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

Sidebar

Related Questions

I have an iOS app sending requests to a PHP based web service ,
I'm developing an iOS app using Core Plot headers. I have different UI for
This app is using iOS 5's built-in dictionary with UISearchBar. I want to include
Our iOS app has a Web View that is rendering pages from file: URLs.
The iOS app Path has this really cool layered scrollView/tableView combination and I'm trying
My iOS app uses data that is packaged by theme into theme bundles. For
In my iOS app, I have three web views defined inside another view. Two
after creating an iOS app which pulls data from a PHP server using JSON.
My iOS app doesn't run in background. When home button is hit the app
Im pretty new at iOS programming, I'm trying to make this budget app. 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.