• 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: Data not retained in document based core data app with cocoa bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Data not retained in document based core data app with cocoa bindings


  • Subject: Re: Data not retained in document based core data app with cocoa bindings
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 12 Oct 2015 21:58:24 -0700

> On 2015 Oct 11, at 09:30, Richard Charles <email@hidden> wrote:
>
>> On Oct 11, 2015, at 2:41 AM, Devarshi Kulshreshtha <email@hidden> wrote:
>>
>> Looking for more clues :-|

Devarshi, I tried the kludge which Richard found on Stack Overflow (self.view.window.windowController.document.managedObjectContext), and it worked for me.  Here you can get the demo from github:

https://github.com/jerrykrinock/CoreDataDocStoryboard/tree/master

The only think you left out of your description is that the table view assembly in the Interface Builder library now as view cells, so to make it work for text you need to drop a text field cell onto the view cell and it magically becomes a text field cell.

> You may want to give up on storyboards and swift for the time being.

Well, at least give up in storyboards in a document-based Mac app.  I got interested in this because I could not believe that such a ludricously long binding

self.view.window.windowController.document.managedObjectContext

was the recommended approach.  But it is the best answer I’ve found so far.  The problem is that the storyboard has these two scenes, “Window Controller” and “View Controller”, with no way to get a message between them, *and* your document only gets access to only *one* of them in -[NSStoryboard instantiateControllerWithIdentifier:].  However, you need access to both: the window controller, to display the window, and the view controller, to bind to your data model.  But neither Cocoa Bindings nor outlet connections can cross from one scene to the other.

I wonder if it possible to pass something in the segue which would be less of a kludge?


_______________________________________________

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


References: 
 >Data not retained in document based core data app with cocoa bindings (From: Devarshi Kulshreshtha <email@hidden>)
 >Re: Data not retained in document based core data app with cocoa bindings (From: Richard Charles <email@hidden>)
 >Re: Data not retained in document based core data app with cocoa bindings (From: Devarshi Kulshreshtha <email@hidden>)
 >Re: Data not retained in document based core data app with cocoa bindings (From: Richard Charles <email@hidden>)

  • Prev by Date: Re: How to make UISplitViewController behave ?
  • Next by Date: Re: Dead Reckoning
  • Previous by thread: Re: Data not retained in document based core data app with cocoa bindings
  • Next by thread: How to make UISplitViewController behave ?
  • Index(es):
    • Date
    • Thread