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"
}

fileUrlDirect プロパティは新しいプロパティであり、JSONKeyPathsByPropertyKey が更新され、json プロパティがモデル プロパティに変換されました。

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

私が走るとき

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

私は受け取ります

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

instanceOfModelClass に新しいプロパティがあることをデバッグして確認しましたが、このエラーが発生する理由がわかりません

私はiOS開発に不慣れで、これが機能するために配線する必要があると思いますが、何がわからないのですか

4

1 に答える 1