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. 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)
- In my paid info.plist, I reference the icon "IconPaid" for the Icon entry. In my Xcode project, I have added IconPaid.png and IconPaid@2x.png.
- In my lite info.pist, I reference the icon "IconFree" for the Icon entry. In my Xcode project, I have added IconFree.png and 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. I took it a step further, and printed out the value for the CFBundleIconFile in my app, and it correctly shows up as "IconFree".
So my question - Where else is the icon file referenced in a Xcode project besides the plist file? 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.
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). You may want to clean all targets and delete your intermediate build files too, and delete the old version from your simulator or device.
精彩评论