0
@interface ModelClass : SCObject
@property (strong, nonatomic) NSString *scObjectID;
@property (strong, nonatomic) NSString *title;
@property (strong, nonatomic) NSString *videoUrlHLS;
@property (strong, nonatomic) NSString *fileUrlDirect;

@implementation ModelClass

+ (NSDictionary *)JSONKeyPathsByPropertyKey
{
    return @{ Key(ModelClass, scObjectID) : @"MediaId",
              Key(ModelClass, title) : @"Title",
              Key(ModelClass, videoUrlHLS) : @"VideoUrlAppleHLS",
              Key(ModelClass, fileUrlDirect) : @"FileUrlS3Direct"
}

The fileUrlDirect property is the new property and the JSONKeyPathsByPropertyKey was updated to translate json property to model property

@property (strong, nonatomic) NSString *fileUrlDirect;
Key(ModelClass, fileUrlDirect) : @"FileUrlS3Direct"

When I run

[MTLManagedObjectAdapter managedObjectFromModel:instanceOfModelClass insertingIntoContext:context error:error];

I receive

[0] (null)  @"NSLocalizedDescription" : @"Could not serialize managed object"   
[1] (null)  @"NSLocalizedFailureReason" : @"No property by name \"fileUrlDirect\" exists on the entity."    

I've debugged and confirmed that the instanceOfModelClass has the new property but I can't figure out why I'm getting this error

I'm new to ios development and I'm guessing there is more to wire up for this to work but I'm not sure what

1 Answers1

0

You are missing property with name fileUrlDirect in your core data entity that you are mapping instanceOfModelClass into.

Yas Tabasam
  • 10,517
  • 9
  • 48
  • 53