开发者

How do I get Xcode to treat an Info.plist as an iPhone/iPad Info.plist?

开发者 https://www.devze.com 2023-01-16 09:40 出处:网络
I have two cocoa-touch apps in one Xcode project.Xcode gives me iPhone/iPad related options for keys in the first\'s Info.plist, such as \"Launch Image (iPad)\".But, Xcode gives me Mac OS X options fo

I have two cocoa-touch apps in one Xcode project. Xcode gives me iPhone/iPad related options for keys in the first's Info.plist, such as "Launch Image (iPad)". But, Xcode gives me Mac OS X options for keys for the second, such as "Java classpaths" and "Quick Look preview height."

Here's how the project was built:

I created the new project as a Universal Window-based Application using Xcode, which came with a default开发者_如何学C Info.plist that translates raw plist keys like UIPrerenderedIcon to more human readable values like "Icon already includes gloss effects." All good.

In the same Xcode Project, I added a second target, also a Cocoa-Touch application, and built it from scratch, including the Info.plist file.

I've opened up the "Active Target" project settings for both apps and have exactly one "Setting Defined at This Level": Product Name. At the higher "Project Settings" level, no Product Name is defined and the Info.plist File is defined as ${EXECUTABLE_NAME}/${EXECUTABLE_NAME}-Info.plist. (Other settings, like Prefix Header, are similarly defined with variable substitution.)

Both apps build, run and use their respective Info.plist files appropriately, but Xcode still tries to give me Mac OS X Info.plist values when editing the second app's Info.plist.

How can I tell Xcode that the plist should be an iPad/iPhone Info.plist, not a Mac OS X Info.plist?


Try this: select/open the Info.plist in question, and then from the menu, do

View > Property List Type > iPhone Info.plist


for Xcode 5 there's no View -> Property List Type so the solution is to open the file, right click anywhere in it and right under Show Raw Keys/Values you'll find the Property List Type menu.

Happy coding, Z.


I'm also curious about this. I ran into the same thing while upgrading an iPhone project for iPad, and after days of trying to figure it out, I just made a new project and reimported the custom classes. I upgraded the target and this time the keys were still for iOS.

My best guess is this is an XCode bug.

0

精彩评论

暂无评论...
验证码 换一张
取 消