當我創建查詢,包含撇號,我得到了錯誤:NSFetchRequest火災NSInvalidArgumentException查詢時ontains撇號
'NSInvalidArgumentException', reason: 'Unable to parse the format string "SELF.sale.ID == 0 AND ((SELF.dam contains[cd] 'Michael's') OR (SELF.name contains[cd] 'Michael's') OR (SELF.purchaserLocation contains[cd] 'Michael's') OR (SELF.purchaserName contains[cd] 'Michael's') OR (SELF.sire contains[cd] 'Michael's') OR (SELF.vendor contains[cd] 'Michael's'))"'
我已經試過有兩個apostrpohes但仍然得到了同樣的錯誤,以取代單引號。 當查詢不包含撇號時,一切都很順利。 感謝
發佈您的代碼,你構建'NSPredicate'。 – Mundi
有必要用撇號撇號替換撇號 –