Re: Layer-hosting views as superview?

2018-03-21 Thread Markus Spoettl
Hi Matt, On 3/21/18 18:40, Matt Jacobson wrote: Hi Markus, There's really no official distinction these days between a layer-hosting view and a regular view.  A view may have a layer (provided by directly calling -setLayer:), or AppKit may (or may not, depending on the exact circumstances) gi

Re: Layer-hosting views as superview?

2018-03-21 Thread Matt Jacobson
> On Mar 21, 2018, at 6:36 AM, Markus Spoettl wrote: > > On 3/21/18 14:26, Markus Spoettl wrote: >> It seems the old rule that layer-hosting views must not have sub-views is no >> longer >> valid. I remember in the old days you couldn't have layer-hosting NSViews >> that have >> sub-views. I

Re: Creating object graph in swift, Core Data or vanilla objects?

2018-03-21 Thread Keary Suska
In that case the only way to avoid having to remove objects first, that I can think of, is to create your own custom persistent store. It’s not too hard, and might be a better solution in the long run anyway. Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" > On

Re: Creating object graph in swift, Core Data or vanilla objects?

2018-03-21 Thread Glen Huang
Thanks for the suggestion Keary, but some view controllers only load portion of the whole graph. For example, in the home screen, I show a list of clubs, and when a user taps a club, I show its members. Showing members shouldn’t wipe out the whole graph, but I do would like to make sure its mem

Re: Creating object graph in swift, Core Data or vanilla objects?

2018-03-21 Thread Keary Suska
Why not just use a different persistent store instance each time? An in-memory store shouldn’t be terribly expensive to create, and you can either keep or dispose of other stores as you need. Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" > On Mar 21, 2018, at

Re: Creating object graph in swift, Core Data or vanilla objects?

2018-03-21 Thread Glen Huang
Thanks for the suggestion Alex. I’m not sure making attributes transient would work though, because the objects themselves would still be persisted, you can still save the context and fetch them back, only that they don’t contain any attributes, if I’m not wrong. By refreshing the object graph,

Re: Layer-hosting views as superview?

2018-03-21 Thread Markus Spoettl
On 3/21/18 14:26, Markus Spoettl wrote: It seems the old rule that layer-hosting views must not have sub-views is no longer valid. I remember in the old days you couldn't have layer-hosting NSViews that have sub-views. I can't find the portion in the documentation that explicitly forbids it (I

Layer-hosting views as superview?

2018-03-21 Thread Markus Spoettl
It seems the old rule that layer-hosting views must not have sub-views is no longer valid. I remember in the old days you couldn't have layer-hosting NSViews that have sub-views. I can't find the portion in the documentation that explicitly forbids it (I'm sure it was there). Can that be righ

Creating object graph in swift, Core Data or vanilla objects?

2018-03-21 Thread Glen Huang
Hi, I'm using Core Data as my model, but I don't want to actually persist anything. Anytime a view controller is shown, I load json data from my server and populate the store. The problem is that objects in Core Data persist between view controllers, even with in-memory store type. But when I