Git Product home page Git Product logo

Comments (2)

adamgit avatar adamgit commented on September 12, 2024

Early versions of this class kept the stack in memory as a singleton, but I
found it made no appreciable difference in real apps, so I removed it for
simplicity. If you WANT TO pass the stack around, go ahead and do so,
there's nothing stopping you.

But please note: Apple's approach is wrong and very dangerous, since their
code is not thread-safe, in a "bad" way. It's best for each class to own
its own local stack of CD classes, and be guaranteed that no other thread
is messing with them.

This is how Apple designed CoreData to work!

On 15 December 2012 15:49, organizr [email protected] wrote:

Hello Adam,

I stumbled upon this helper class you made and while I like the idea, I
noticed you don't follow Apple convention of passing the context from the
Application Delegate to the subsequent view controllers.

Instead, you seem to load everything up every time you want to operate
with core data. I don't know if this is is more correct but I wanted your
opinion on why you made it this way.

What I mean is, loading a managed object model from disk in every view
controller, just seems like you will make the app spend to much time
loading the model when you can easily pass a pointer to the
ManagedObjectContext instance to your controllers.

The only reason I can see for doing this is having more than one model,
but maybe I am not seeing something.

Well, thank you in advance for your reply.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1.

from coredatastack.

organizr-zz avatar organizr-zz commented on September 12, 2024

Well, I just wanted to know the reasons for this decision, so that was helpful.

Thank you very much.

from coredatastack.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.