속성 이름을 기반으로 레코드를 가져 오려고합니다.코어 데이터 가져 오기 요청 오류
나는 비슷한 문제를 검색하려고하지만 난 질문을 게시하고, 그래서 해결책을 찾을 수 없습니다입니다 ...
만 가져 오는 동안 나는 예외를 가지고 :
[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>'
내 코드 :
를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)
}
, 감사합니다
'predicate_str'이란 무엇입니까? '엔티티 '란 무엇입니까? – jrturton
@jrturton, 엔티티는 "대답"& predicate_str = "imagePath LIKE [c] audio_1.m4a" – nirav