0
votes

I have a Core Data entity called "Image". Initially I was going to save images in JPG format to this with an "image" attribute that was of type "Binary Data". However, I have since changed my mind and will store the image in the Documents directory of my app. I would like to save the file paths in the "image" attribute but want to change the type to "string".

What type of migration should I perform for this? The app is still in development - not been uploaded to iTunesConnect and not on AppStore yet.

What do I do with the NSManagedObject subclass I created? Do I trash it and create a new one or is there some sort of adjustment that I can make? Do I need to keep the subclass as some sort of reference for the data model?

1

1 Answers

0
votes

You only need migration to migrate existing data.

You have to modify your NSManagedObject subclass. The easiest way is to create a new NSManagedObject subclass and copy everything related to the image property to the old subclass. Or copy everything you changed in the old subclass to the new subclass. If you didn't change anything you can replace the subclass.

Migration doesn't use any subclasses.