I need to get both the attribute name and the value for the attribute when I'm reading from my core data, is there any easy way of doing this?
I've been trying to retrieve the first element in my object model as a Dictionary, but that gives me an error saying:
fatal error: NSArray element failed to match the Swift Array Element type
My code looks like this:
let appDel:AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
let context:NSManagedObjectContext = appDel.managedObjectContext!
let fetchReq = NSFetchRequest(entityName: "ActiveIndexes")
fetchReq.resultType = NSFetchRequestResultType.DictionaryResultType
receivedList = context.executeFetchRequest(fetchReq, error: nil) as! [ActiveIndexes]
println(receivedList[0])
Any suggestions would be appreciated.