ios - Get fields from NSArray with CoreData content -


i have table in core data fields, can count of records, can´t values each field, have code:

var request:nsfetchrequest = nsfetchrequest(entityname: "radar") //my table in core data  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 count can 

i need more, radar have fields: descr,latit,long need fields create annotation this: results.descr

you need loop array of results , cast each result nsmanagedobject retrieved, in case radar

if results.count > 0 {     result in results     {          if let r = result as? radar{              //now can access properties of radar in r              println(r.descr)          } else{              println("could not cast fetch result radar")          }     }    } 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -