【发布时间】:2017-03-12 20:21:33
【问题描述】:
我通过
成功获取了我的Board数据let boards: [Board] = try! db.fetch(FetchRequest<Board>())
之后我会遍历 boards 并制作一个
print(board)
最多输出:
Board {
id = 1;
name = The Name;
shortDescription = The Description;
slug = the_name;
}
但是当我想直接访问 board 名称时,例如
board.name
抛出以下错误:
fatal error: unexpectedly found nil while unwrapping an Optional value
我的错误是什么? 如果 board 不是一个对象,我怎样才能实现它是一个对象?
我正在使用:
SugarRecord
ObjectMapper
RealmSwift
ObjectMapper_Realm
【问题讨论】:
标签: ios swift realm objectmapper