Convert NSArray to Swift Array

后端 未结 4 1693
终归单人心
终归单人心 2020-12-29 03:23

In CoreData I have defined an ordered to-many relationship. This relationship is defined in Swift like this:

@NSManaged var types : NSMutableArray
<         


        
4条回答
  •  既然无缘
    2020-12-29 04:01

    Enumerate them that way :

    for type in types.array {
        // Do something
    }
    

    Or use simply the array property of the NSOrderedSet you are using, like so :

    types.array
    

提交回复
热议问题