使用coredata的时候,不可避免的要用到两个表之间的关系relationShip,有一对一关系,也有一对多关系,这里我要说的是关系的保存:
to one relationShip:
let relationShip = team?.mutableSetValueForKey("relationShipName")
relationShip?.addObject(object)//要加入的对象
to many relationShip:
let relationShip = team?.mutableSetValueForKey("relationShipName")
ues?.addObjectsFromArray(array)//要加入对象数组