我正在尝试分配布尔类型的属性的值。当我尝试这样做时,我最终出现了这个错误
作业似乎已崩溃:分段错误:11
下面是代码:
NSMutableArray *emails = [[NSMutableArray alloc] init];
NSError *error = nil;
//This is your NSManagedObject subclass
SalesPerson * client = nil;
NSFetchRequest * request = [[NSFetchRequest alloc] init];
[request setEntity:[NSEntityDescription entityForName:@"SalesPerson" inManagedObjectContext:self.managedObjectContext]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name == %@", query];
[request setPredicate:predicate];
NSArray *results = [self.managedObjectContext executeFetchRequest:request error:&error];
client = [results objectAtIndex:0];
client.mailed = TRUE;
NSLog(@"client email %@",client.email);
[emails addObject:client.email];
我有三个属性 name , email 和 mailed 。当我尝试更改实体的邮寄属性时,它会抛出上述错误。Mailed 是布尔类型。其他属性是更新时确实更改的字符串。