在 Xcode 中更改项目名称导致命名错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12848712/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:47:15  来源:igfitidea点击:

Changed project name in Xcode causing naming error

iosxcodexcode4xcode4.5xcode4.6

提问by HurkNburkS

My old name consisted of a camel case type name similar to this

我的旧名称由类似于此的驼峰式名称组成

MyApp

我的应用程序

I then changed it to

然后我把它改成

Myapp'notice the A is now non-caps'

Myapp'注意 A 现在是非大写'

I changed this by clicking MyAppname in the navigator menu and changing it, up came a help box asking me to do system wide changes I clicked YES!

我通过单击MyApp导航器菜单中的名称并更改它来更改它,出现了一个帮助框,要求我进行系统范围的更改,我单击“是”!

but now when I build this application its saying the name of my app is:

但是现在当我构建这个应用程序时,它说我的应用程序的名称是:

Myapp-temp-caseinsensitive-rename

Myapp-temp-caseinsensitive-rename

I am now wondering how do I get rid of the -temp-caseinsensitive-rename portion?

我现在想知道如何摆脱 -temp-caseinsensitive-rename 部分?

回答by iDev

Check the product name in build settings and make sure everywhere it is Myapp. If that is done,

检查构建设置中的产品名称,并确保它在任何地方都是 Myapp。如果这样做,

  • Close your project -> go to finder.
  • Right click on your .xcodeproject file and click on show package contents.
  • Then right click on your project.pbxproj and open it in some text editor.
  • Then search for Myapp-temp-caseinsensitive-rename and manually rename it.
  • Save it after changing and then reopen the project.
  • 关闭您的项目 -> 转到查找器。
  • 右键单击您的 .xcodeproject 文件,然后单击显示包内容。
  • 然后右键单击您的 project.pbxproj 并在一些文本编辑器中打开它。
  • 然后搜索 Myapp-temp-caseinsensitive-rename 并手动重命名。
  • 更改后保存,然后重新打开项目。

Make sure you have taken a back up of your project before doing this.

在执行此操作之前,请确保您已备份您的项目。

回答by Vivek Gani

I had a similar issue, but it only affected a Target that got affixed with "case-insensitive-rename". If you have a similar situation, just do the following (using XCode 5):

我有一个类似的问题,但它只影响贴有“不区分大小写重命名”的目标。如果您有类似情况,只需执行以下操作(使用 XCode 5):

1) click on your project in the left. 2) expand to see all your targets by clicking the tiny button

1) 单击左侧的项目。2) 单击小按钮展开以查看所有目标

step 2 - tiny expand button

第 2 步 - 微小的展开按钮

3) rename affected Target(s).

3) 重命名受影响的目标。

step 3 - rename

第 3 步 - 重命名

4) Save project. Then for OCD brownie points, open your project in a text editor and do a ctrl-f for any "insensitive" or similar to ensure everything's resolved.

4) 保存项目。然后对于 OCD 布朗尼点,在文本编辑器中打开您的项目并对任何“不敏感”或类似内容执行 ctrl-f 以确保一切都得到解决。

回答by Mehdi Abderezai

None of these worked for me, I found this post and it worked, and it was the simplest. So I guess the solution depends on how you got yourself in the mess in the first place :)

这些都不适合我,我找到了这篇文章并且它有效,而且它是最简单的。所以我想解决方案首先取决于你是如何让自己陷入困境的:)

-temp-caseinsensitive-rename in Bundle Identifier

捆绑标识符中的 -temp-caseinsensitive-rename

回答by Ryan

Go to project -> Build Settings -> Search "Packaging"and change the product namekey.

转到project -> Build Settings -> Search "Packaging"并更改产品名称密钥。

If that does not work, repeat but within your target, so Targets -> YourApp -> Build Settings -> Search "Packaging"

如果这不起作用,请重复但在您的目标范围内,所以 Targets -> YourApp -> Build Settings -> Search "Packaging"

Voila.

瞧。

回答by Ritu

Try building a new scheme of your app by selecting on project name on top of xcode after play and stop button. Worked for me!

尝试通过在播放和停止按钮后选择 xcode 顶部的项目名称来构建您的应用程序的新方案。对我来说有效!

回答by Reza Dehnavi

In my case hold down the option keyon the keyboard and go to

在我的情况下,按住键盘上的选项键并转到

Project -> Clean Build Folder (option+shift+command+k)

项目 -> 清理构建文件夹(option+shift+command+k)

After that close and reopen Xcode.

之后关闭并重新打开 Xcode