Ich versuche, Datensatz basierend auf Attributnamen abzurufen.Core Data Fetch Request Fehler
Ich versuche auch ähnliches Problem suchen, aber ich bin nicht in der Lage Lösung zu finden, so dass ich Frage bin Entsendung ...
aber ich habe Ausnahme beim Abrufen:
[error] error: exception handling request: <NSSQLFetchRequestContext: 0x1c019a270> , keypath audio_1.m4a not found in entity <NSSQLEntity answer id=8> with userInfo of (null)
CoreData: error: exception handling request: <NSSQLFetchRequestContext: 0x1c019a270> , keypath audio_1.m4a not found in entity <NSSQLEntity answer id=8> with userInfo of (null)
2017-09-28 19:03:36.725060+0530 app[9684:891158] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath audio_1.m4a not found in entity <NSSQLEntity answer id=8>'
Mein Code:
let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: Entity)
if let predic = predicate_str{
let predicate = NSPredicate(format: predic)
fetchRequest.predicate=predicate
}
do {
let arr = try appsession.managedObjectContext.fetch(fetchRequest) //CRASHED
// success ...
} catch let error as NSError {
// failure
print("Fetch failed: \(error.localizedDescription)")
return(nil,error)
}
Danke,
Was ist 'Prädikat_str'? Was ist "Entität"? – jrturton
@jrturton, Entität ist "Antwort" & Prädikat_str = "imagePath LIKE [c] audio_1.m4a" – nirav