Re: Core Data Inverse To-Many/To-One Bug?
Re: Core Data Inverse To-Many/To-One Bug?
- Subject: Re: Core Data Inverse To-Many/To-One Bug?
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 2 Jun 2005 01:27:43 -0700
On Jun 1, 2005, at 1:36 PM, Niko Matsakis wrote:
NSManagedObject *langobj = [array objectAtIndex:0];
[wordobj setValue:langobj forKey:@"language"]; // XXX
NSMutableSet *mutset = [langobj
valueForKey:@"vocabulary"];
[mutset addObject:wordobj];
[...]
"2005-06-01 22:22:23.302 Flash[24497] *** -[_NSFaultingMutableSet
objectAtIndex:]: selector not recognized [self = 0x34f960]
This suggests the problem is in the line before XXX. Where is
'array' coming from? My *guess* is that it's from a relationship?
In which case it's a set, not an array...
NSMutableSet *mutset = [langobj
valueForKey:@"vocabulary"];
Here you should be using 'mutableSetValueForKey:', not 'valueForKey:'.
<http://developer.apple.com/documentation/Cocoa/Reference/
CoreData_ObjC/Classes/NSManagedObject.html>
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden