-3
我想爲核心數據NSFetchRequest
創建NSPredicate
。屬性toBeDeleted
是NSNumber
。我需要在格式字符串中插入boolValue
嗎?NSPredicate的正確格式
let predicate = NSPredicate(format: "toBeDeleted.boolValue == true")
我想爲核心數據NSFetchRequest
創建NSPredicate
。屬性toBeDeleted
是NSNumber
。我需要在格式字符串中插入boolValue
嗎?NSPredicate的正確格式
let predicate = NSPredicate(format: "toBeDeleted.boolValue == true")
由於@Kevin和@馬特已正確地指出here,正確的方式做到這一點是沒有.boolValue
所以。您是否嘗試閱讀關於如何[製作NSPredicate]的文檔(https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSPredicate_Class/index.html)或謂詞如何[格式字符串](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html#//apple_ref/doc/uid/TP40001795)必須構建?您是否嘗試過_running_您編寫的代碼? – matt
是的,因爲我只是一個初學者,所以我還在閱讀並同時頭痛。 – flightsimmer668
嘗試不帶'.boolValue' – Kevin