Re: Optionality in a NSManagedObject sub-class

2017-02-10 Thread Daryle Walker
> On Feb 10, 2017, at 3:02 AM, Daryle Walker wrote: > > It’s simple: > > - I’m writing this framework for an app, both macOS, with Swift 3 and Xcode 8. > - My protocol has two non-optional strings. > - I unchecked “Optional” for those attributes when editing the model file. >

Re: Intercept Save when closing NSDocument

2017-02-10 Thread Kevin Perry
NSSavePanelDelegate is probably the approach you want to take, with -[NSDocument prepareSavePanel:] being the most convenient means of inserting your delegate. > On Feb 10, 2017, at 9:41 AM, Quincey Morris > wrote: > > On Feb 10, 2017, at 08:12 , Trygve

Re: Intercept Save when closing NSDocument

2017-02-10 Thread Quincey Morris
On Feb 10, 2017, at 08:12 , Trygve Inda wrote: > > I would like to disable the Save button > for a demo version of our app. Have you looked at the NSSavePanelDelegate methods? One approach would be to use panel:validateURL:error: to prevent the save proceeding.

Re: UI bindings

2017-02-10 Thread Keary Suska
> On Feb 9, 2017, at 5:52 PM, Ariel Feinerman wrote: > > I have finished the core of my programme and now I am designing the UI. The > issue is that it has several tabs and about a hundred fields. I wish to > make a mechanism which can gather values and save them in the

Re: Intercept Save when closing NSDocument

2017-02-10 Thread Trygve Inda
On 2/10/17, 9:19 AM, "Keary Suska" wrote: > >> On Feb 10, 2017, at 9:12 AM, Trygve Inda >>wrote: >> >> When I close an NSDocument, it puts up a sheet offering (Don¹t

Re: Intercept Save when closing NSDocument

2017-02-10 Thread Jens Alfke
> On Feb 10, 2017, at 9:19 AM, Keary Suska wrote: > > I would start by overriding -saveDocument: and -saveDocumentAs: in your > NSDocument subclass with a breakpoint so I can see what is being done. Even easier: wait for the save dialog to appear, then hit the Pause

Re: Intercept Save when closing NSDocument

2017-02-10 Thread Keary Suska
> On Feb 10, 2017, at 9:12 AM, Trygve Inda wrote: > > When I close an NSDocument, it puts up a sheet offering (Don¹t Save, > Cancel, Save). > > Is there a way to intercept this? I would like to disable the Save button > for a demo version of our app. I could mark the

Intercept Save when closing NSDocument

2017-02-10 Thread Trygve Inda
When I close an NSDocument, it puts up a sheet offering (Don¹t Save, Cancel, Save). Is there a way to intercept this? I would like to disable the Save button for a demo version of our app. I could mark the document as having no changes, but then it would just close directly and not allow a cancel

Optionality in a NSManagedObject sub-class

2017-02-10 Thread Daryle Walker
It’s simple: - I’m writing this framework for an app, both macOS, with Swift 3 and Xcode 8. - My protocol has two non-optional strings. - I unchecked “Optional” for those attributes when editing the model file. - I used “Manual/None” for generation, then used the menu command to create the