Get fields from NSArray with CoreData content

i have a table in coredata with some fields, i can get the count of records but i can´t get the values from each field, now i have this code:


        var request:NSFetchRequest = NSFetchRequest(entityName: "Radar") //my table in coredata
    
        let appDelegate:AppDelegate = (UIApplication.sharedApplication().delegate as! AppDelegate)
        let context:NSManagedObjectContext = appDelegate.managedObjectContext!
    
        request.returnsObjectsAsFaults = false
    
        var results:NSArray = context.executeFetchRequest(request, error: nil)!
    
        println(results.count) //this is the count that i can do


i need some more,

Radar have this fields: Descr,Latit,Long

i need get this fields to create a annotation

some like this: results.Descr 😝

thks in advance

Answered by SaPires in 9886022

Thks to all, the answer is:


if results.count > 0 { for result in results { let r = result as! Radar println(r.descr) } }
Accepted Answer

Thks to all, the answer is:


if results.count > 0 { for result in results { let r = result as! Radar println(r.descr) } }
Get fields from NSArray with CoreData content
 
 
Q