Comments (6)
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 NSManagedObject
s 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.
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.
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.
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.
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.
@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)
- Can't run app in simulator with BNRCoreDataStack in Objective-C project, LaunchServicesError HOT 1
- Build issues with Xcode 8 beta 3 HOT 4
- Creating CoreDataStack without dispatching HOT 2
- NSPersistentStoreCoordinator options. HOT 5
- (Swift 3) Make `performAndWaitOrThrow` `rethrows` and `@noescape` HOT 1
- Issue compiling project with BNRCoreDataStack using Xcode 8 - Swift 2.3 HOT 1
- Publish Pod version 2.0.0 HOT 1
- performAndWaitOrThrow not accessible HOT 5
- Linker issue HOT 2
- Linker issue HOT 5
- Entity name check should not fail because of module name HOT 5
- BNRCOredatastack 1.3.0 issue in xcode 8.2 unable to install on device
- Question: is `.findFirstInContext(...)` not available any more on iOS < 10? HOT 3
- Support programatically created object models HOT 2
- Carthage validation script fails for forks
- Use withoutActuallyEscaping for helpers on Swift 3.1 HOT 5
- How can i use CoreDataStack in an Objective-C project HOT 1
- Xcode 9 support HOT 1
- crash on update of app from app store HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coredatastack.