I am building an app using Swift2 and Realm to persist the data. The data relationships could be described as parent-to-child-to-grandchild objects. Each object has it's own subclass written with the same format. I am getting the runtime error "RLMObject subclasses cannot be nested within other declarations. Please move _TtCC12 ... to global scope.'" on the grandchild object. Any suggestions?
答案 0 :(得分:3)
错误消息告诉您RealmSwift.Object
子类的声明必须位于最外层,并且不能嵌套在其他类或结构声明或函数定义中。