Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个实体 -Quote并且Customer(一个客户可以有很多报价)
Quote
Customer
假设我有一个名为的托管对象,quote但我想更新客户地址。是否有让我到达客户地址的密钥路径?如:
quote
quote!.setValue(address, forKeyPath: “some_amazing_keypath")
假设 Customer 实体有一个属性“address”保存地址,keypath 应该只是“customer.address”:
quote!.setValue(address, forKeyPath: “customer.address")
但是,如果您为实体指定一个子类,生活会容易得多:然后您可以使用:
quote!.customer.address = address