я пытаюсь добавить объект отношения "ко многим" в существующую запись.
мой код выглядит так:
User *user = [self fetchUserwithInformation:firstName lastName:lastName];
NSMutableSet *userRecord;
userRecord = [person mutableSetValueForKey: @"userInformation"];
Information *information = (Information *)[NSEntityDescription insertNewObjectForEntityForName:@"Information" inManagedObjectContext:managedObjectContext];
information.age = @"99";
information.gender = @"m";
NSSet *set = [NSSet setWithObject:information];
[userRecord addObject:information];
этот код вылетает из-за необработанного исключения:
'NSInvalidArgumentException', reason: 'Unacceptable type of value for to-many relationship: property = "userInformation"; desired type = NSSet; given type = __NSArrayM; value = ( ...some values...
Я думаю, что я добавляю NSSet (setWithObject: information) ...?
заранее спасибо