0
これは、「多くの」関係オブジェクトを既存のエントリに追加しようとしているからです。キャッチされない例外によりにaddObject to MutableSetクラッシュ - 理由: '多対多の関係の値の受け入れがたい型
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:情報)を追加していだと思いますか...?事前