Data not retained in document based core data app with cocoa bindings
Data not retained in document based core data app with cocoa bindings
- Subject: Data not retained in document based core data app with cocoa bindings
- From: Devarshi Kulshreshtha <email@hidden>
- Date: Sun, 11 Oct 2015 00:04:16 +0530
I am trying to make a simple document based core data app using cocoa
bindings by following below steps:
*Step 1: *Selected the default template for a document based mac os x app
with core data as enabled
*Step 2:* It generated below files -
*a*. AppDelegate.swift
*b*. ViewController.swift
*c.* Document.swift
*d*. Main.storyboard
*e*. Document.xcdatamodel, etc
*Step 3:* Added an entity - MyColorPalette with an attribute - myColorName
of type string
*Step 4:* In Main.storyboard added a table view over view controller
*Step 5:* Dragged an 'ArrayController' object from library onto
ViewControllerScene
*Step 6:* Dragged an 'NSObject' object from library onto ViewControllerScene
*Step 7:* Changed class of 'NSObject' object to 'Document'
*Step 8:* Updated entity of ArrayController as - MyColorPalette and
managedObject as - Document.managedObjectContext
*Step 9:* Selected table view column and performed its value binding with
arrayController, controller key as - arrangedObjects and modelKeyPath
as myColorName
*Step 10:* Added two buttons - 'Add' and 'Delete', mapped respective 'add:'
and 'remove:' actions with 'ArrayController' object
Now when I am running the app and trying to add or delete it is working
perfectly, but when I am trying to save the document and then re-open it,
it is not showing the previously saved information.
I am sure that I am missing something over here, looking for guidance.
Here is the link to its source code at github:
https://github.com/Daemon-Devarshi/DocumentSample
--
Thanks,
Devarshi
_______________________________________________
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