2015-07-04 66 views
-3

我想爲核心數據NSFetchRequest創建NSPredicate。屬性toBeDeletedNSNumber。我需要在格式字符串中插入boolValue嗎?NSPredicate的正確格式

let predicate = NSPredicate(format: "toBeDeleted.boolValue == true") 
+0

所以。您是否嘗試閱讀關於如何[製作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

+0

是的,因爲我只是一個初學者,所以我還在閱讀並同時頭痛。 – flightsimmer668

+0

嘗試不帶'.boolValue' – Kevin

回答

0

由於@Kevin和@馬特已正確地指出here,正確的方式做到這一點是沒有.boolValue