当我创建查询,包含撇号,我得到了错误: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
有必要用撇号撇号替换撇号 –