NSPredicate with Swift and Core Data

前端 未结 3 1734
星月不相逢
星月不相逢 2021-02-02 13:29

i have a Core Data Object and i have 2 Fieds (one String(GUID) and one Int which i want to use as Filter)

So in SQL it would be \"SELECT * FROM Answers WHERE qIndex = 1

3条回答
  •  再見小時候
    2021-02-02 13:52

    If formUUID is an NSString or a Swift String then you have to use the %@ placeholder:

    let resultPredicate2 = NSPredicate(format: "formUUID = %@", formUUID)
    

提交回复
热议问题