Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArray instance variable and core data objects



Hi

I'm having trouble defining a NSArray instance variable within a core data app. A particular object has a number of methods which access managed objects, retrieve values, then feed these values to a neural network. The order in which the values are retrieved is important therefore I was attempting to create a NSArray instance variable to store an ordered list of managed objects.


from header file: NSArray *inputCharacteristicTypes;

from source file:
inputCharacteristicTypes = [NSArray arrayWithArray:[[self mutableSetValueForKey:@"inputCharacteristicTypes"] allObjects]];



Unfortunately, when the application is run I get the following error at the end of the method that contains the above code.


*** NSRunLoop ignoring exception 'Cannot create NSSet from object (
<NSManagedObject: 0x139fa30> (entity: CharacteristicType; id: 0x139fa60 <x-coredata:///CharacteristicType/t66420BDA-6E0C-402F-B756- C701F781D733> ; data: {...}) ) of class NSCFArray - consider using contentArray binding instead of contentSet binding' that raised during posting of delayed perform with target 486d170 and selector 'invokeWithTarget:'


What really confuses me is the fact the above code works foe NSSet and individual objects. eg.

from header file:
NSSet *inputCharacteristicTypesSet;
id *anInputCharacteristicType;

from source file:
inputCharacteristicTypesSet = [self mutableSetValueForKey:@"inputCharacteristicTypes"];
anInputCharacteristicType = [inputCharacteristicTypes objectAtIndex:0];


Any idea where I'm going wrong?

Cheers

Tim

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.