mercredi 15 juin 2016

Core Data NSPredicate not working


Please help me there is no any specific error, run time stop

there is screenshot

func fachDataById(entityName: String, colummName: String, value: Int) -> Bool {
    let appDeleget = UIApplication.sharedApplication().delegate as! AppDelegate
    let manegeContext = appDeleget.managedObjectContext
    let fetchRequist = NSFetchRequest(entityName: entityName)
    print("ok fetchRequist")
    fetchRequist.predicate = NSPredicate(format: "%K == %@", colummName, value)

    do{
        let results = try manegeContext.executeFetchRequest(fetchRequist)
        print(results)
        return true
    }
    catch{
        print("Error")
        return false
    }
}

Aucun commentaire:

Enregistrer un commentaire