Giter Club home page Giter Club logo

Comments (6)

rcedwards avatar rcedwards commented on July 4, 2024

Hi @Yourney

This one is a bit tricky because MoGenerator is providing you with the entityName() function to provide some of the niceties and convenience methods we're also achieving by having NSManagedObject subclasses implement the CoreDataModelable.

Since our convenience methods depend on having a way of accessing your subclasses entity name there would be no way for us to move our functions directly to an extension on NSManagedObject.

Going forward if you're targeting iOS 10/macOS 10.12 and later NSManagedObjects get entity automatically via Xcodes subclass generation, so we'll be moving our functions into an extension then.

A solution for your case will have to be removing/renaming the conflicting name that is generated in the _Base class. Obviously not ideal though since this is supposed to be an auto generated file.

Thanks

from coredatastack.

Yourney avatar Yourney commented on July 4, 2024

Hi Robert,

Thanks for your reply.
I see your point(s).

When using MoGenerator, I think one does not use 'Xcodes subclass generation'. Or do I misunderstand?
I think there must be a way to coexist ...
Changing the MoGenerator Template is not very desirable, but it should work.

Regards,
Wouter

from coredatastack.

Yourney avatar Yourney commented on July 4, 2024

Wouldn't it solve this incompatibility if you'd make the protocol compatible with MoGenerator by making the var entityName a function?

Regards,
Wouter

from coredatastack.

rcedwards avatar rcedwards commented on July 4, 2024

Hi @Yourney that would possibility resolve the particular issue you're facing but that would be a breaking API change on our side.

Compatibility with MoGenerator is not a common request we've seen at this time and therefore something we're not current pursuing. Thanks

from coredatastack.

Yourney avatar Yourney commented on July 4, 2024

I do not want to push or stalk or anything ... so if I am too persistent, please tell me ;-)
How does the typical BNRCoreDataStack user or use case produce the NSManagedObject subclasses? Perhaps there is an easier way for me to use that is compatible with BNRCoreDataStack?

I think that the Xcode built in subclassing mechanism is 'not automatic' and has no 'custom' subclass. Before I worked with MoGenerator, I used the Xcode function, and put my own stuff in a category. But MoGenerator gave me more flexibility.

Regards,
Wouter

from coredatastack.

rcedwards avatar rcedwards commented on July 4, 2024

@Yourney sure so in 2015 Apple introduced a template for generating NSManagedObject subclasses (still manually) that would place all the properties into an extension of your object so that you could freely edit your subclass and continually generate updates to your model that would replace the previous on disk.
Whats new in Core Data 2015

You can follow those steps and add CoreDataModelable conformance to your subclass.

In my experience I've typically shied away from automatically generating my subclasses for greater control. Especially since after you've established your initial model you're usually looking at minor changes.

from coredatastack.

Related Issues (20)

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.