How can I decode an object when original class is not available?

后端 未结 5 796
面向向阳花
面向向阳花 2021-02-05 00:52

I have an iOS 7 application that saves a custom object to app\'s iCloud Docs folder as a file. For this, I make use of NSCoding protocol.

@interface Person : NSO         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 01:09

    I think you could resolve it as follow:

    @implementation PersonOldVersion
    
    + (void)load
    {
        [NSKeyedUnarchiver setClass:[PersonOldVersion class] forClassName:@"Person"];
    }
    

提交回复
热议问题