0

Trying to launch the project on Xcode 13.0. Project launches with no issues on Xcode 11.7. When trying to launch on Xcode 13, the issue appears when building the application.

Property has a previous declaration for every property of a MyClass+CoreDataProperties.h

It seems to be creating exactly the same MyClass+CoreDataProperties.h file and considers original file as the origin and the built file as the duplicate properties file.

I have even removed those files from Build Phases -> Compile Sources. I have the exactly same file structure with another naming and it works fine.

The file looks something like this:

#import "MyClass.h"

NS_ASSUME_NONNULL_BEGIN

@interface MyClass (CoreDataProperties)

+ (NSFetchRequest<MyClass *> *)fetchRequest NS_SWIFT_NAME(fetchRequest());

@property (nullable, nonatomic, copy) NSNumber *choice;
@property (nullable, nonatomic, copy) NSString *content;
@property (nullable, nonatomic, copy) NSString *correctAnswer;
@property (nullable, nonatomic, retain) NSObject *extraData;
@property (nonatomic) BOOL isCorrect;
@property (nullable, nonatomic, copy) NSDate *timeAnswered;
@property (nullable, nonatomic, copy) NSDate *timeAsked;

@end

NS_ASSUME_NONNULL_END
  • 1
    If you created the subclasses yourself navigate to the Core Data model file, select an entity, press ⌥⌘4 to show the Data Model Inspector and set `Codegen` to *Manual/None* – vadian Oct 20 '21 at 12:57
  • @vadian I believe the CoreDataProperties and CoreData itself is from a package CoreData.framework. The ⌥⌘4 doesn't open anything. What should it do? – Andrew f0s3 Kosenko Oct 20 '21 at 13:04
  • You should have a model file (ending with `xcdatamodel`) – vadian Oct 20 '21 at 13:08
  • Yes, it fixed an error, though now it shows another one: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_MyClass", referenced from: objc-class-ref in DataManager.o ld: symbol(s) not found for architecture x86_64 Or on the warnings and errors sidebar says: Undefined symbol: _OBJC_CLASS_$_MyClass Not sure if this issue should be considered fixed. – Andrew f0s3 Kosenko Oct 20 '21 at 13:13

1 Answers1

-1

As mentioned by @vadian in the comments to the question, the solution would be to find the .xcdatamodel file and change the Codegen to Manual/None.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 21 '21 at 06:55