NSArrayController can't removeObject(s) because of missing managed object context
NSArrayController can't removeObject(s) because of missing managed object context
- Subject: NSArrayController can't removeObject(s) because of missing managed object context
- From: Olger Warnier <email@hidden>
- Date: Tue, 24 Jul 2007 21:45:13 +0200
Hi List,
I try to programatically remove objects inside the NSArrayController,
but this gives an issue:
Exception raised during posting of notification. Ignored.
exception: Cannot perform operation without a managed object context
In effect, I try to manipulate a list of custom objects (the
NSArrayControler attributes are set to a class like 'MyItem' bound to
a 2 TableColumns in a TableView (via the bindings the
arrangedObjects.myFirstValue is bound)
This gives me the possibility to add code like:
MyItem *newItem = [[MyItem alloc] init];
[newItem setState:state];
[newItem setDescription:@"description"];
[myNSArrayController addObject:newItem];
[newItem release];
This properly works as additions are seen in my TableView.
When I try to remove all objects in the list (clear the view), I
try something like:
[myNSArrayController removeObjects:[myNSArrayController
arrangedObjects]];
This results in the exception that it can't be done without a managed
object context.
My question is can this be done without a managed object context ? I
assume that is used for core data binding towards a storage engine,
and I do my own (filesystem) based storage. (objects are referring to
stored items, but do not contain them)
The list contains some stories but assume the need for the core data
managed object context. (it seems)
If so, I'd love some suggestions to see if this can work.
I could figure out a way to Core Data enable the code (make this
managed object context and stuff), but I am not sure if that is
helpfull for the longer term.
Kind Regards,
Olger
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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:
This email sent to email@hidden