In CoreData I have defined an ordered to-many relationship. This relationship is defined in Swift like this:
@NSManaged var types : NSMutableArray
However, to use Swift at it's best, I want to use a normal Swift array like Type[]. However, CoreData forces me to use NS(Mutable)Array. How can I type-cast / convert the NSArray to Array<Type>[]?
Apparently the confusion arises from the following error:
let array = obj.types as T[] // Cannot convert expression's type 'Node[]' to type '$T2'
While this is accepted by the editor:
let array = obj.types as AnyObject[] as T[] // No complaint