ios - Core Data NSPredicate not working -


please me there no specific error, run time stop

there 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     } } 

the problem %@ format value:int , cast value nsobject or anyobject following:

nspredicate(format: "%k == %@", colummname, value nsobject) 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -