Removing Object form ArrayController without managedObjectContext
Removing Object form ArrayController without managedObjectContext
- Subject: Removing Object form ArrayController without managedObjectContext
- From: Gustavo Pizano <email@hidden>
- Date: Mon, 29 Mar 2010 21:43:08 +0200
Hello all.
before this email I had a problem with a to-many relationship, that after saving the other view wasn't showing the invoice details, I found the error, but I can't find the solution.
So what was happening, was that after saving I was clearing the data of the NSArraycontroller that was used by the table that allowed insertion of ItemXInvoice items, then after save was successful, I was doing the following:
//===============================================================
//Clears the Fields of the view
//===============================================================
-(void)clearFieldsData{
[_itemsArrayController removeObjectsAtArrangedObjectIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [[_itemsArrayController arrangedObjects] count])]];
[_dueDateSelection release];
_newInvoice = nil;
}
so my table was clean again and ready to create a new invoice, or at least that was what I thought, but unfortunately when I wanted to check the created invoice in the other view, I couldn't see any detail, ItemXInvoices, but after closing the app, I was NOT able to see them. I commented the line that called the above method and then I was able to see the invoice details of the newly created invoice.
My guess was that when removing the objects form the array controller, these were being removed form the MOC, and therefore I couldn't see them in the consultation mode, only after restarting the app when the MOC fetch again the data.
Now I need to be able to clean the table after saving, otherwise I can't create more items unless I restart the app, or if I clean the table I must restart the app in order to see the newly created invoice's details.
I dunno what can I do here...
Please any advice will be appreciate it.
Thanks in advance
Gustavo
_______________________________________________
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