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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:34:45+00:00 2026-06-03T07:34:45+00:00

My iOS app hangs on savaging when i segue between 2 screens a couple

  • 0

My iOS app hangs on savaging when i segue between 2 screens a couple of times.
it belongs to store the data but than this just freeze with no errors.
Somebody any idea how i can fix this ?

self.fetchF = dispatch_queue_create(label, NULL);
dispatch_async(self.fetchF, ^{

    NSArray *feeds = [FeedFetcher getData:self.pageTitle downloadBy:@"up"];

    NSManagedObjectContext *newContext = self.managedObject;

    for (NSDictionary *feedInfo in feeds) {
        [Feed FeedWithInfo:feedInfo InManageObject:newContext];
    }

    dispatch_async(dispatch_get_main_queue(), ^{

        NSError *error = nil;
        if (newContext != self.managedObject)
            [newContext save:&error];

        if (error)
            NSLog(@"Error save : %@", error);

        [self setupFetchedResultsController];

        [self downloadImages:feeds];
    });        
});

Edit :

I change my managedobjectcontext so it has every thread a new one.
But now when i segue between 2 screens a couple of times it freeze on [self.fetchedResultsController performFetch:&error]; With no errors..
Does somebody a idea for a solution ?

- (void)performFetch
{
    if (self.fetchedResultsController) {
        if (self.fetchedResultsController.fetchRequest.predicate) {
            if (self.debug) NSLog(@"[%@ %@] fetching %@ with predicate: %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd), self.fetchedResultsController.fetchRequest.entityName, self.fetchedResultsController.fetchRequest.predicate);
        } else {
            if (self.debug) NSLog(@"[%@ %@] fetching all %@ (i.e., no predicate)", NSStringFromClass([self class]), NSStringFromSelector(_cmd), self.fetchedResultsController.fetchRequest.entityName);
        }
        NSError *error;
        if (self.fetchedResultsController != nil)
            [self.fetchedResultsController performFetch:&error];

        if (error) NSLog(@"[%@ %@] %@ (%@)", NSStringFromClass([self class]), NSStringFromSelector(_cmd), [error localizedDescription], [error localizedFailureReason]);
    } else {
        if (self.debug) NSLog(@"[%@ %@] no NSFetchedResultsController (yet?)", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    }
    [self.tableView reloadData];
}
  • 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-03T07:34:46+00:00Added an answer on June 3, 2026 at 7:34 am

    Core Data is generally not thread-safe. Rule of thumb is to create a NSManagedObjectContext per thread. I believe you’re reusing your context among threads and that’s causing the problem.

    Docs on Core Data concurrency:

    Core Data uses thread (or serialized queue) confinement to protect
    managed objects and managed object contexts (see “Concurrency with
    Core Data”). A consequence of this is that a context assumes the
    default owner is the thread or queue that allocated it—this is
    determined by the thread that calls its init method. You should not,
    therefore, initialize a context on one thread then pass it to a
    different thread. Instead, you should pass a reference to a persistent
    store coordinator and have the receiving thread/queue create a new
    context derived from that. If you use NSOperation, you must create the
    context in main (for a serial queue) or start (for a concurrent
    queue).

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

Sidebar

Related Questions

I got an iOS app with table view. When i select rows several times,
I have an iOS app in the Apple App Store. For the next big
My iOS app was rejected because I use the /Document directory to store downloaded
This app is using iOS 5's built-in dictionary with UISearchBar. I want to include
I have an iPhone (iOS) app that keeps data in a local SQLite database
My iOS app is going to be free, but with additional functionality enabled via
I'm developing an iOS App and I want to make a table view, but
Our (internally distributed) iOS app relies on iOS 4.2's encryption to secure sensitive data.
I am developing an iOS app using iOS 4.2 SDK, but I want the
Is there anyway in ios app to adjust the linespacing between the multiple lines

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.