我在所有 ViewController
中都有一个 MSSyncTable* table
实例变量。目前,我直接从服务器获取数据并使用 pullWithQuery
函数填充此 table
。
- (void)syncTableData:(ESCompletionBlock)completion
{
MSQuery *query = [self.table query];
// Pulls data from the remote server into the local table.
// We're pulling all items
[self.table pullWithQuery:query queryId:@"EventTable" completion:^(NSError *error) {
[self logErrorIfNotNil:error];
// Let the caller know that we finished
dispatch_async(dispatch_get_main_queue(),completion );
}];
我想改变这种方法,用从我的核心数据
中获取的数据填充表
。我已经用我需要在屏幕上显示的数据填充了核心数据。
如何让 table
从 Core Data 获取数据?
最佳答案
pullWithQuery 调用的目的是从远程 azure 应用服务中提取数据并将其存储在核心数据中。完成此操作后,标准表调用将改用核心数据。
有关离线同步的教程,请参阅此内容:https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-ios-get-started-offline-data
关于ios - 如何将核心数据填充到Azure移动服务的本地表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41568534/