【问题标题】:Cannot get data from my Dropbox Datastore using the Dropbox Datastore API无法使用 Dropbox Datastore API 从我的 Dropbox Datastore 获取数据
【发布时间】:2013-11-29 16:51:57
【问题描述】:

当我使用 Dropbox Datastore API 并链接到另一台 iOS 设备时,我无法在我的数据存储区中获取数据,但我可以使用我设置为使用的第一台 iOS 设备获取数据存储区中的数据数据存储 API。这可能是什么问题?

在两个设备上运行的代码当然是相同的。

DBAccount * account = [[DBAccountManager sharedManager] linkedAccount];
DBDatastore *dataStore = [DBDatastore openDefaultStoreForAccount:account error:nil];
DBTable *table = [dataStore getTable:@"crane"];

__pastCranes = [InspectionBussiness getRecords:nil DBAccount:account DBDatastore:dataStore DBTable:table];

感谢大家的帮助!

【问题讨论】:

  • 您有多个 Dropbox 帐户吗? (也许您要在两台设备上关联不同的帐户。)
  • 刚查过,只用一个账号...

标签: ios mobile sync dropbox datastore


【解决方案1】:

嘿,所以我想通了。将 Dropbox 帐户链接到此设备后,您必须添加此行。对我来说是:

[dataStore sync:nil];

这更新了我设备上的数据存储。然后我可以装载起重机。

这很奇怪,因为它不会立即起作用。在更新的信息出现在表格视图中之前,我必须运行该应用程序几次。

【讨论】:

  • 嗯,每次有变化时你都应该打电话给sync。您应该在数据存储上设置一个观察者,如果DBDatastoreIncoming 标志为真,您应该调用sync。见dropbox.com/developers/datastore/tutorial/ios#listeners。如果您从不调用sync,您将永远不会看到来自服务器的新数据。
  • 请帮助我@smarx ..这是我的问题stackoverflow.com/questions/21347592/…
  • 嘿,我面临同样的问题。请帮助我@adeji
  • 您的问题到底是什么?数据只是没有出现在另一台设备上? @Jack1231
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-06-25
  • 2013-07-17
  • 2021-10-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多