自从将项目更新为Swift 1.2后,我在创建NSPredicate实例时遇到了“EXEC_BAD_ACCESS(code = 1,address = ...)异常。”
这是我创建它的方式:
var predicate = NSPredicate(format: "width = %@ AND height = %@ AND lang = %@", width, height, language)
所有参数都有值。在1.2中发生了哪些改变导致这种情况失败的想法?
答案 0 :(得分:1)
尝试%d的宽度和高度
var predicate = NSPredicate(format: "width = %d AND height = %d AND lang = %@", width, height, language)