简体   繁体   中英

Unable to change Product Name in Xcode

I am developing for iOS 6 on Xcode 4.6.1

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. 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 .

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.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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