【问题标题】:Would 'type: Undefined' default to AnyObject?'type: Undefined' 会默认为 AnyObject 吗?
【发布时间】:2016-01-08 19:11:21
【问题描述】:

在下图中,如果我不给属性分配类型,默认会是什么类型?

【问题讨论】:

  • 你试过了吗?它编译了吗?

标签: swift core-data ios9


【解决方案1】:

来自 Apple 的文档:

NSUndefinedAttributeType 对瞬态属性有效——Core Data 仍将属性作为 id 值跟踪并注册撤消/重做操作,等等。 NSUndefinedAttributeType 对于非瞬态属性是非法的。

Type Undefined 用于非标准类型属性。 Xcode 创建 NSManagedObject 子类时,类型为 UNKNOWN_TYPE。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-13
    • 1970-01-01
    • 2012-02-27
    相关资源
    最近更新 更多