[英]How to add properties in info.plist in iOS
I want to open PDF attachment via email in my own application: I refer two link here:我想在我自己的应用程序中通过 email 打开 PDF 附件:我在这里引用两个链接:
How do I associate file types with an iPhone application? 如何将文件类型与 iPhone 应用程序相关联?
and here on Raywenderlich 在 Raywenderlich 上
where it shows some XML content, and says its added to info.plist.My info.plist is shown like this attachment.它显示了一些 XML 内容,并说它已添加到 info.plist。我的 info.plist 显示如下附件。 How can I add content to info.plist to make it visible as XML document.
如何将内容添加到 info.plist 以使其显示为 XML 文档。
My info.plist:我的信息.plist:
plist files is nothing more than XML document that Xcode view in his own way. plist 文件只不过是 Xcode 以他自己的方式查看的 XML 文档。 You can Right click -> Open as -> Source Code to get view you want.
您可以右键单击 -> 打开为 -> 源代码以获取所需的视图。
Also you can add to plist directly by clicking plus sign or Right click -> Add Row.您也可以通过单击加号或右键单击 -> 添加行来直接添加到 plist。 Default view of plist can give you a suggestions, so I recommend you to use this instead of viewing as XML
plist 的默认视图可以给你一个建议,所以我建议你使用它而不是查看为 XML
info.plist is a system level plist in iPhone application, you can add properties by adding a property like this: info.plist 是 iPhone 应用程序中的系统级 plist,您可以通过添加这样的属性来添加属性:
右键单击 Xcode 中的 .plist 并选择“Open As -> Source code”
may be worth mentioning how to get there..可能值得一提的是如何到达那里..
Info.plist is one of the file below the Main.storyboard or viewController.swift Info.plist 是 Main.storyboard 或 viewController.swift 下面的文件之一
when you click on it first time it usually is in a table format,so right click the file and 'open as' Source code and then add the code当您第一次单击它时,它通常是表格格式,因此请右键单击该文件并“打开为”源代码,然后添加代码
If you want to view it as XML, just find the plist file and open it with your favorite editor.如果您想以 XML 格式查看它,只需找到 plist 文件并使用您喜欢的编辑器打开它。 Something like TextWrangler.
类似 TextWrangler 的东西。 And then add your key-value pairs.
然后添加您的键值对。
XCODE 13 XCODE 13
You do not see your info.plist
file in project folder until you try to modify it for the first time (lets say by adding value) in target -> Info - example seen on below:在您第一次尝试在目标 -> 信息中修改它(比方说通过添加值)之前,您不会在项目文件夹中看到您的
info.plist
文件 - 示例如下所示:
After you add any value in targets, the info.plist
will be created and available for you somewhere in your project folder (example below)在目标中添加任何值后,将创建
info.plist
并在项目文件夹中的某个位置供您使用(如下例)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.