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

  • Home
  • SEARCH
  • 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 8046957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:57:21+00:00 2026-06-05T05:57:21+00:00

In my iOS application I have registered the AppDelegate as notification listener for CoreData

  • 0

In my iOS application I have registered the AppDelegate as notification listener for CoreData changes. With this piece of code:

[[NSNotificationCenter defaultCenter] addObserver:self
    selector:@selector(mergeChangesFromContextDidSaveNotification:)
        name:NSPersistentStoreDidImportUbiquitousContentChangesNotification
      object:[self persistentStoreCoordinator]];

And the mergeChangesFromContextDidSaveNotification method get correctly called every time there’s an update.

However inside this method I am trying to call an NSTimer for doing another operation:

- (void)mergeChangesFromContextDidSaveNotification:(NSNotification *)notification {

        NSTimer *t =[NSTimer scheduledTimerWithTimeInterval:10.0
                                                           target:self 
                                                         selector:@selector(mergeCoreDataFromCloud:)
                                                         userInfo:nil 
                                                          repeats:NO];

    }
}

and the point is that mergeCoreDataFromCloud: which should be fired by the timer is never called. This is the signature:

-(void)mergeCoreDataFromCloud:(NSTimer*)timer {
  // never called...
}

please note that I am at early stage of development, the code is not perfect, and I am only interested in knowing why the timer is not started.
I suppose it has something to do with threads, but I have no guess…

thanks

  • 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-05T05:57:22+00:00Added an answer on June 5, 2026 at 5:57 am

    A timer relies on the run loop being run in the mode(s) in which it has been scheduled.

    In a Cocoa app, the main thread runs its run loop automatically. However, no other thread can be relied on to run its run loop automatically.

    So, usually you want to schedule timers on the main thread. You can also schedule them on a thread you create and control, which you cause to run its run loop in an appropriate mode.

    There’s no enough information in your question to know what thread this code is being called on.

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

Sidebar

Related Questions

I have a IOS application created through phonegap framework. I have registered a particular
I have an iOS application where I use coreData to store my documents. They
I have an iOS application (but this is just as applicable to an OS
In my iOS application I have made a form that should submit data into
I have an iOS application that use an Web Server to grab Sports information.
We have an iOS application for the iPad that is having strange behavior. We
i have an iOS application witch uses the current location of the user. I
I have an iOS application with several controllers, each with their own xib files.
I have an iOS application. Application has 2 different views: Main and Settings. In
I have an IOS application which uses environment variables and am able to set

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.