且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

领域错误:属性需要定义所包含类型的协议

更新时间:2022-01-30 22:08:01

Property requires a protocol defining the contained type error仅由Realm针对类型为NSNumber的属性生成,而没有协议注释预期的具体类型.这意味着不能为您提到的任何一个模型类生成它.您的应用程序其他位置可能还有另一个routineId属性,该属性会触发错误.

The Property requires a protocol defining the contained type error is only generated by Realm for a property of type NSNumber without a protocol annotating the expected concrete type. That means it cannot be generated for either of the model classes you mention. It's likely you have a another routineId property elsewhere in your app that is triggering the error.