简体   繁体   English

无法在Xcode中更改产品名称

[英]Unable to change Product Name in Xcode

I am developing for iOS 6 on Xcode 4.6.1 我正在Xcode 4.6.1上为iOS 6开发

Midway through my project I decided to change name of both the project as well as the app name. 在项目进行中,我决定同时更改项目名称和应用名称。

Changing the project name was pretty straightforward. 更改项目名称非常简单。 As mentioned by many, I am supposed to 正如许多人所说,我应该

Double click slowly on the Xcode Project name on the top left. 慢慢双击左上方的Xcode项目名称。 Change this name and a window will pop up asking you to rename the whole project, select yes and the name of your project will be changed. 更改此名称,将弹出一个窗口,要求您重命名整个项目,选择是,项目名称将被更改。

But I noticed that my app target did not change. 但是我注意到我的应用目标没有改变。

So I tried to manually rename it. 因此,我尝试手动重命名。 When I change my app target and run the app, it crashes. 当我更改应用程序目标并运行应用程序时,它崩溃了。

This is the log: 这是日志:

*** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '***
-[NSURL initFileURLWithPath:]: nil string parameter'

I went through my code and found out that this line was causing the error: 我检查了一下代码,发现此行引起了错误:

NSString *url = [[NSBundle mainBundle]
                 pathForResource:videoName
                 ofType:@"mp4"];

The url has the value nil . url的值为nil

If I revert the target name back to the original, it works. 如果我将目标名称恢复为原始名称,则可以使用。

I tried a project build clean. 我尝试了一个干净的项目构建。 I also tried resetting and cleaning the simulator. 我还尝试过重置和清洁模拟器。 Nothing seems to work. 似乎没有任何作用。 Any help will be highly appreciated. 任何帮助将不胜感激。

Thanks :) 谢谢 :)

在“构建阶段”->“复制捆绑资源”列表中检查mp4文件,然后在窗口->管理器->项目->您的项目上按“删除...”。

When you double click and rename, it would have shown an alert, read carefully and check that all options are selected. 双击并重命名时,它会显示一个警报,请仔细阅读并检查是否选中了所有选项。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM