框架下载,请参考简书的另一篇文章:IOS 标准MVC架构
这里主要说一下下载下来后修改项目名称。
因为调试了一上午的时间发现总是或多或少存在无法运行,所以在调试成功后直接把正确方法写下来
一、修改主文件夹名称

解压后的文件夹名字,修改成你确定的名字。
二、修改项目中的项目文件夹、Tests文件夹、UITest文件夹为新名称:只替换名字,后缀内容勿动。Tests和UITests中的 .m文件同样修改名字,打开.m文件把@interface和@implementation对应的名字一并修改。

三、右击MobileProject.xcodeproj,显示包内容,右击project.pbxproj使用文本编辑器进行编辑


全部替换成新名字。
四、打开项目空间:MobileProject.xcworkspace,直接修改

Renameproject content items?选择Rename
五、修改schemess

>>> ManageSchemes

六、修改Pods

七、修改文件名

这四个位置同样修改了名字。
然后直接运行,我的程序出现了错误:
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory error: The sandbox is not in sync with the Podfile.lock.
Run 'pod install' or update your CocoaPods installation.
我在终端CD到项目,执行pod install,提示:Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default。如果执行正确最好,但是我的还是有问题。我执行 pod repo update。
等待执行完成后提示:
CocoaPods 1.4.0.rc.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.4.0.rc.1
还是不能用,这个时候我再次执行pod install,会重新安装第三方。然后再次运行。

这个位置不知怎么回事名字没有改过来,修改了。再次运行便可以正常启动项目了。
网友评论