代码之家  ›  专栏  ›  技术社区  ›  cpjolicoeur

How to handle web-app data sync with iPhone Fetched Results Controller

  •  0
  • cpjolicoeur  · 技术社区  · 14 年前

    I'm in the middle of developing a companion iPhone app for an existing web application.

    To give a brief overview, the iPhone app is a tab bar based application with each tab containing navigation controllers.

    现在,我知道我在Web应用程序上从API进行的所有数据传输和处理都在工作,我想将同步的数据从主线程移到应该在的后台。

    1 回复  |  直到 14 年前
        1
  •  2
  •   falconcreek    14 年前

    You can create a separate NSManagedObjectContext to use during your syncing operation. 退房 TopSongs sample project. 它使用CD和 NSOperation to perform the refresh on a separate thread. When you save in your syncing context notifications will be posted which you can use to signal that you need to update your view. 登记 NSManagedObjectContextDidSaveNotification in your viewController that has the FRC.