简体   繁体   English

为什么我的XCode项目包含我的iOS应用程序的错误图标文件?

[英]Why does my XCode project include the wrong icon file for my iOS Application?

I am creating a lite version of my app, and used Chris Fletcher's blog here as a guide to setting up an Xcode project for multiple apps. 我正在创建应用程序的精简版,并在此处使用Chris Fletcher的博客作为为多个应用程序设置Xcode项目的指南。 I have everything working great except for the icon file. 除了图标文件,我的一切都很好。

Here is an overview of what I have: 以下是我的概述:

  • 2 info.plist files (One for each version of the application) 2个info.plist文件(每个版本的应用程序一个)
  • In my paid info.plist, I reference the icon "IconPaid" for the Icon entry. 在我的付费info.plist中,我为Icon条目引用了图标“IconPaid”。 In my Xcode project, I have added IconPaid.png and IconPaid@2x.png. 在我的Xcode项目中,我添加了IconPaid.png和IconPaid@2x.png。
  • In my lite info.pist, I reference the icon "IconFree" for the Icon entry. 在我的lite info.pist中,我为Icon条目引用了图标“IconFree”。 In my Xcode project, I have added IconFree.png and IconFree@2x.png. 在我的Xcode项目中,我添加了IconFree.png和IconFree@2x.png。

When I go to build both apps, my lite app shows up with the paid icon. 当我去构建这两个应用程序时,我的精简应用程序会显示付费图标。 I took a look at the package contents of my lite app, and sure enough the IconPaid files were included but not the IconFree files. 我看了一下我的Lite应用程序的包内容,确定包含了IconPaid文件,但没有包含IconFree文件。 I took it a step further, and printed out the value for the CFBundleIconFile in my app, and it correctly shows up as "IconFree". 我更进一步,在我的应用程序中打印出CFBundleIconFile的值,它正确显示为“ IconFree”。

So my question - Where else is the icon file referenced in a Xcode project besides the plist file? 所以我的问题 - 除了plist文件之外,Xcode项目中引用的图标文件还有哪些? I thought that was the only place... 我以为这是唯一的地方......

It sounds like your free target is copying the paid version of the icon instead of the free version. 听起来你的免费目标是复制图标的付费版本而不是免费版本。 Look under Targets/Project-Name/Copy Bundle Resources and check that the free version is copying the correct icon file. 在Tar​​gets / Project-Name / Copy Bundle Resources下查看并检查免费版本是否正在复制正确的图标文件。

I'm not sure why the IconPaid.png is showing in the free app (assuming your build settings of your free target are referencing the proper info.plist). 我不确定为什么IconPaid.png会在免费应用程序中显示(假设您的免费目标的构建设置引用了正确的info.plist)。 You may want to clean all targets and delete your intermediate build files too, and delete the old version from your simulator or device. 您可能希望清除所有目标并删除中间构建文件,并从模拟器或设备中删除旧版本。

暂无
暂无

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

相关问题 为什么Xcode在iOS Simulator和Device上都运行项目的旧版本? - Why Xcode runs the older version of my project both on iOS Simulator and the Device? 为什么我的iOS事件以错误的顺序触发? - Why are my iOS events firing in the wrong order? 获取在iOS上安装的“我的应用”的Xcode文件 - Get the Xcode File of My App Installed on iOS 为什么我无法在XCode的Project Assistant窗口中看到基于视图的应用程序 - Why i cannot see a View Based Application in my Project Assistant window in XCode 为什么我的AppleScript无法获得我的Xcode项目? - Why can't my AppleScript get my Xcode project? 为什么从Xcode运行时,我的ios应用似乎只继续执行后台任务 - Why does it seem that my ios app only continues background task when running from xcode 更改源文档后,UIWebView不会刷新位于iOS应用程序中服务器上的PDF文件 - UIWebView does not refresh a PDF file located on my server in my iOS application after changes to the source document Xcode 8 iOS Simulator不提示我的Swift 3项目中的位置服务授权 - Xcode 8 iOS Simulator is not prompting for location services authorization in my Swift 3 project Xcode newb - #include无法找到我的文件 - Xcode newb — #include can't find my file 删除armv7s xCode 4.6有效架构项目属性如何影响我的iOS应用程序的App Store分发? - How does removing armv7s xCode 4.6 valid architecture project property affect App Store distribution of my iOS apps?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM