简体   繁体   English

iOS中如何在info.plist中添加属性

[英]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.然后添加您的键值对。

To review properties in info.plist查看info.plist属性

  • Open as -> Source Code打开为 -> 源代码
  • Version editor

在此处输入图片说明

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.

相关问题 如何在已删除 Info.plist 的 Xcode 13 中将数组项添加到自定义 iOS 目标属性? - How to add an array item to Custom iOS Target Properties in Xcode 13 where Info.plist has been removed? PhoneGap:修改config.xml以向Info.plist离子iOS添加属性 - PhoneGap: modify config.xml to add properties to Info.plist ion iOS 如何国际化iOS公共plist资源文件而不是“ info.plist”? - How to internationalize iOS common plist resource file not “info.plist”? Xcode:如何将密钥添加到生成的 Info.plist 文件中(或合并生成的和现有的 Info.plist)? - Xcode: How to add key into generated Info.plist file (or merge generated and existing Info.plist)? 在Info.plist iOS中将IP范围添加到传输安全层 - Add IP Range to Transport Security Layer in Info.plist iOS 在cordova ios应用程序中将字段添加到info.plist - Add fields to info.plist in cordova ios app 是否有可能在 Info.Plist 或 iOS 中的权利中添加注释? - Is it possible, good practice, to add comments to Info.Plist, or entitlements in iOS? 如何在 Windows Visual Studio xamarin.ios 应用程序中将密钥 NSBluetoothPeripheralUsageDescription 添加到 info.plist - How to add key NSBluetoothPeripheralUsageDescription to info.plist in a Windows Visual Studio xamarin.ios app 如何在 info.plist 文件中为 IOS 添加 flutter_downloader 集成 - how to add flutter_downloader integration for IOS in the info.plist file 如何将自定义条目添加到 iOS watchKit 扩展 info.plist 中? - How can I add custom entries into iOS watchKit extension info.plist?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM