iphone - NSMutableOrderedSet for To-Many Relationship in Subclass -
when xcode creates managed subclass to-many relationship, types relationship member of class nsset
, this:
class someobject: nsmanagedobject { @nsmanaged var member: string @nsmanaged var anotherone: int @nsmanaged var relatedentities: nsset }
which makes creating new related entities arduous forced create mutable buffer, in:
let buffer = nsmutableset(set: someobject.relatedentities) buffer.addobject(newrelatedentity) someobject.relatedentities = nsset(set: buffer)
my question: safe change type of relatedentities
member nsmutaleset
, eg:
@nsmanaged var relatedentities:
for access addobjects
method, or create problems in context/model/anything?
edit:
also, okay use
@nsmanaged var relatedentities: [relatedentity]
Comments
Post a Comment