How to write to a Realm object server on Ubuntu

与世无争的帅哥 提交于 2019-12-06 02:58:06

I think I found the probem.

In the tutorial's updateList() function:

func updateList() {
 if self.items.realm == nil, let list = self.realm.objects(TaskList.self).first {
  self.items = list.items
 }
 self.tableView.reloadData()
}

self.items will never get set because self.realm.objects(TaskList.self).first will return nil until there is a task added to the list. You need to add a task (in my case using the Mac version of the app) before the iOS version of the code will work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!