func getFetchRequest(#entityName: String, address value: String) -> NSFetchRequest {
var fetch = NSFetchRequest(entityName: entityName)
fetch.predicate = NSPredicate(format: "address = %s", value)
println(fetch)
return fetch
}
问题是它正在使用Xcode< 6.1并停止使用6.1。
传递getFetchRequest(entityName: "Entity", address: "test")
给出以下内容
(
entity: Entity;
predicate: (address == "s");
sortDescriptors: ((null));
type: NSManagedObjectResultType;
)
答案 0 :(得分:0)
Solution found in another answer可能会计算此副本。
<强>解决方案强>
NSPredicate(format: "address = %s", value)
应该是:
NSPredicate(format: "address = %@", value)