Rename xcdatamodel file

前端 未结 10 2148
暖寄归人
暖寄归人 2020-12-05 00:55

What do in need to do to rename the .xcdatamodel file. Renaming .xcdatamodel filename, along with changing ...

NSURL *modelURL = [[NSBundle mainBundle] URLFo         


        
10条回答
  •  半阙折子戏
    2020-12-05 01:43

    In Xcode 4.2, I renamed my model (*.xcdatamodeld) file in project navigator (it automatically renamed *.xcdatamodel file inside a package, and both files in my filesystem).

    In initWithContentsOfURL: of the NSManagedObjectModel, I used a new name.

    This resulted in what @Mustafa is describing in the question (nil model).

    So I tried adding a new version of my model and it solved the problem (even though I had no changes in my model).

提交回复
热议问题