Re: Displaying Core Data using Cocoa binding programmatically
Re: Displaying Core Data using Cocoa binding programmatically
- Subject: Re: Displaying Core Data using Cocoa binding programmatically
- From: "Bill So" <email@hidden>
- Date: Sat, 13 May 2006 13:56:09 +0800
Dear George,
Thanks for your suggestion.
I think the bindings are set properly.
In my code excerpt, data is saved in core data:
myObj = [NSEntityDescription
insertNewObjectForEntityForName:@"Account"
inManagedObjectContext:[appDelegateObj managedObjectContext]];
[myObj setValue:@"testing" forKey:@"id"];
[myObj setValue:@"peter" forKey:@"first_name"];
[myObj setValue:@"jackson" forKey:@"last_name"];
[[self managedObjectContext] save:&error];
"save" method is called. And data is saved properly. (I've examined
the XML file)
When I run my sample code for the first time, the programmatically
inserted record is not shown in the table view.
However, if I re-run the application again, the data just inserted in
the previous run programmatically is shown in the table view. And,
only 1 record is shown in the table view even, in the second run, the
code in the excerpt above is run again.
So, I suspect that I need to call some methods in the array controller
to fetch the data again for display.
Hm... any clues?
Thanks
Bill
On 5/12/06, George Orthwein <email@hidden> wrote:
How exactly is the array controller bound to the table view?
I would option drag the core data entity from Xcode to IB to create a
prototype GUI so you can:
1) verify that the core data store is actually getting the new values.
2) examine the table view bindings in the prototype GUI to replicate
for your table
option drag described here:
http://developer.apple.com/documentation/Cocoa/Conceptual/
NSPersistentDocumentTutorial/02_CreatingProj/chapter_3_section_4.html
George
_______________________________________________
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