【发布时间】:2011-10-12 00:18:36
【问题描述】:
为了在 Core Data 中使用,我尝试构建一个 NSPredicate 对象。 minLength 和 maxLength 的类型为int:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"length >= %@ AND length <= %@",
minLength, maxLength];
程序在此处崩溃并显示EXC_BAD_ACCESS。如果我使用%d 而不是%@,情况并非如此:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"length >= %d AND length <= %d",
minLength, maxLength];
我在这里错过了什么?
【问题讨论】:
标签: objective-c exc-bad-access