• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Displaying Core Data using Cocoa binding programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Displaying Core Data using Cocoa binding programmatically
      • From: George Orthwein <email@hidden>
References: 
 >Displaying Core Data using Cocoa binding programmatically (From: "Bill So" <email@hidden>)
 >Re: Displaying Core Data using Cocoa binding programmatically (From: George Orthwein <email@hidden>)

  • Prev by Date: Re: Should objects returned by indirection be autoreleased
  • Next by Date: Re: Should objects returned by indirection be autoreleased
  • Previous by thread: Re: Displaying Core Data using Cocoa binding programmatically
  • Next by thread: Re: Displaying Core Data using Cocoa binding programmatically
  • Index(es):
    • Date
    • Thread