【发布时间】:2015-06-01 17:31:38
【问题描述】:
我想从我的实体中获取数据,其中特定列 (isDelete) 的值为 nil or NO 。我使用下面的代码:
NSManagedObjectContext *managedObjectContext = [LIUtility sharedUtility].managedObjectContext;
NSEntityDescription *entity = [NSEntityDescription entityForName:@"NumberStorage" inManagedObjectContext:managedObjectContext];
NSFetchRequest *fetch = [[NSFetchRequest alloc] init];
[fetch setEntity:entity];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(type = %d) and isDelete != YES",type];
[fetch setPredicate:predicate];
allCardNumber = [managedObjectContext executeFetchRequest:fetch error:nil];
但它不起作用。
我应该如何查询这个请求?
【问题讨论】:
标签: ios objective-c iphone core-data