Changed in XCode to mapping model aren't updated in simulator bundle

有些话、适合烂在心里 提交于 2019-12-22 18:44:12

问题


I created a mapping model to migrate between two core data models. I then edited my mapping model, (added a custom migration policy, changed a mapping name, etc.), ran the simulator, and... nothing changed. The old mapping model was loaded, ignoring my changes. Looking into the bundle that the simulator runs, the size of the .cdm file didn't change as well.

Another strange problem is that sometimes the the mapping model can't even be found, resulting in a migration error. In this case, the .cdm file in the bundle exists but is very small - less than 0.5k (my working file is ~14k).

I've tried running "Clean", emptying Xcode's DerivedData directory and resetting the simulator. They solve the problem only for new mapping models, but editing them will again not work. This makes it virtually impossible to work with mapping models. Very frustrating :-(


回答1:


Doing a clean all (holding down the option key while selecting clean from the menu) will remove the derived data and will allow the changes in the mapping model to be picked up.

Out of habit, I always do a clean all when I am working with any files inside of Xcode that are not specifically source code files.

I would also suggest filing a radar. This has been an issue since mapping models came out in Leopard.

It is not an issue with the Simulator but an issue with Xcode not watching for those files to change. Once the compiled copies are removed (via the clean all), Xcode will copy over the entire app bundle to the sim again.

However, when you are testing a migration, I find it helpful to "reset" the sim anyway, usually bad to a copy that didn't have the mapping model or the new model that you are migrating to.



来源:https://stackoverflow.com/questions/8243109/changed-in-xcode-to-mapping-model-arent-updated-in-simulator-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!