I have a multi-targeted app and I want to move identical classes from 2 different targets sources to a common framework on top of them.
However, the two classes I want to move are generated by 2 different Core Data Models (one for each app). They are identical because the entities in both model are identical.
So, for example, they both have the following code:
@property (nonatomic, retain) NSSet* Character;
@interface MyClass (CoreDataGeneratedAccessors)
- (void)addCharacterObject:(Character *)value;
- (void)removeCharacterObject:(Character *)value;
- (void)addCharacter:(NSSet *)value;
- (void)removeCharacter:(NSSet *)value;
And this code is more tricky: SubStage1 and SubStage2 are 2 core data model classes and they both are subclasses of SubStage.
Here the code is different:
@property (nonatomic, retain) SubStage1 * SubStage1;
and
@property (nonatomic, retain) SubStage2 * SubStage2;
Can I change the previous code from both subclasses into:
@property (nonatomic, retain) Stage * Stage;
I’m wondering if the same code is supposed to interact with a different core data model, depending on the compiled target. I’m afraid it is not working anymore because the core data entities SubStage1 and SubStage2 refer to the subclasses SubStage1 and SubStage2…
I hope the question is clear.
thanks
If the classes are identical use only one, but include it in both targets. Each target can have its own data model file, but share the same class module.