如果他/她插入重复的记录,我需要用警报停止用户:
列 1 列 2 列 3 (ABC) 允许 (BAL) 允许 (ABC) 不允许,因为它的记录重复
AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [appDelegate managedObjectContext];
NSManagedObject *newAdds;
newAdds = [NSEntityDescription insertNewObjectForEntityForName:@"Matches" inManagedObjectContext:context];
[newAdds setValue:club01.text forKey:@"club01"];
[newAdds setValue:club02.text forKey:@"club02"];
[newAdds setValue:matchDateVar forKey:@"matchDate"];
[newAdds setValue:matchTaypVar forKey:@"matchType"];