我正在尝试将app名称用作NavController标题,但无论我做什么,我都无法获得CFBundleDisplayName值.它返回'null'.
这是我正在使用的代码
[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"]
Run Code Online (Sandbox Code Playgroud)
已检查的捆绑包=只有一个.Xcode5/dev目标是iOS5.我没有检查过设备.使用模拟器.
谢谢!
我们为每个配置使用具有不同plist的设置.像这样: Target-Info-Dev.plist,Target-Info-Beta.plist ......
这样我们的配置可以拥有自己的CFBundleDisplayName,我们可以通过设备上的app-name来区分构建.像这样:"DEV Appname","BETA Appname"......
但是,现在我们需要本地化app-name.我们通过为每个目标创建本地化的InfoPlist.strings来完成此操作:
"CFBundleDisplayName" = "<localized-appname>";
"CFBundleName" = "<localized-appname>";
Run Code Online (Sandbox Code Playgroud)
但由于CFBundleDisplayName不再从Target-Info- [Configuration] .plist派生,我们无法区分不同配置的app-name.
应该注意的是,对于同一个应用程序的不同品牌,我们也有几个目标,但我们已经通过为每个目标创建单独的InfoPlist.strings来实现这一目标.
任何人都知道如何完成本地化和基于配置的应用程序名称?
configuration localization ios info-plist cfbundledisplayname
我正在通过我的iOS Xcode项目正常工作,然后当我尝试运行它时突然间,我开始收到以下错误:
error: couldn't parse contents of '/Users/pavitarsidhu/Desktop/AmigoDash/SidebarDemo/AmigoDash-Info.plist': The data couldn’t be read because it isn’t in the correct format.
Run Code Online (Sandbox Code Playgroud)
我真的很困惑.我查看了过去的StackOverflow问题,仍然无法解决这个问题.反正只是生成一个新的infoplist?你们有什么感想?
在我的Mac上更新我的Xamarin,xCode并尝试上传到App Store之后,我收到了来自Apple的这种电子邮件:
缺少Info.plist值 - 捆绑包'com.xxxx.yyyy'中缺少Info.plist键'CFBundleIconName'的值.使用iOS 11或更高版本SDK构建的应用必须在资产目录中提供应用图标,并且还必须为此Info.plist密钥提供值.有关详细信息,请参阅http://help.apple.com/xcode/mac/current/#/dev10510b1f7.一旦纠正了这些问题,您就可以重新更新已更正的二进制文件.
据我所知,我需要将我的图标转换为资产目录,但我不知道如何在Visual Studio 2015(Windows)中执行此操作?这是我的info.plist的一部分:
<key>CFBundleDisplayName</key>
<string>Name - Online</string>
<key>CFBundleIdentifier</key>
<string>com.xxxxx.xxxxxx</string>
<key>CFBundleVersion</key>
<string>3.4</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon-72@2x.png</string>
<string>Icon-72.png</string>
<string>Icon@2x.png</string>
<string>Icon.png</string>
<string>Icon-60@2x.png</string>
<string>Icon-76.png</string>
<string>Icon-76@2x.png</string>
<string>Default.png</string>
<string>Default@2x.png</string>
<string>Default-568h@2x.png</string>
<string>Default-Landscape.png</string>
<string>Default-Landscape@2x.png</string>
<string>Default-Portrait.png</string>
<string>Default-Portrait@2x.png</string>
<string>Icon-Small-50@2x.png</string>
<string>Icon-Small-50.png</string>
<string>Icon-Small-40.png</string>
<string>Icon-Small-40@2x.png</string>
<string>Icon-Small.png</string>
</array>
<key>CFBundleShortVersionString</key>
<string>4.4</string>
Run Code Online (Sandbox Code Playgroud) 在哪里设置我的自定义变量?
我想在info.plist文件中使用它.例如:
Bundle name = ${BUNDLE_NAME}
Bundle identifier = com.mycompany.${BUNDLE_NAME}
Run Code Online (Sandbox Code Playgroud) 在WWDC 2017 第201届会议上,Cocoa Touch的新功能,在33:50左右,据说"通过在资产目录中加入[图标],我们现在能够让他们参与应用程序细化,这将大大降低你应用程序的足迹.所以,这是一个非常令人兴奋的事情,它将在iOS 11的新项目中默认采用.你可以通过在Info.plist中添加一个密钥来选择现有项目."
您需要在Info.plist中添加哪些密钥才能在现有项目的资产目录中为图标启用应用程序细化?我没有在Information Property List Key Reference中看到它.
我们的应用程序操作扩展需要支持所有类型的附件。它几乎适用于任何地方,唯一无法工作的情况是当我尝试共享在 Safari 中打开的 PDF 文件时。例如这个: https: //carlosicaza.com/swiftbooks/SwiftLanguage.pdf
该应用程序甚至没有出现在 Safari 的共享表上,我认为Action Extension 目标NSExtensionActivationRule中一定缺少某些内容。info.plist
这就是NSExtensionActivationRule目前的样子。我尝试了几件事,但到目前为止还没有运气。
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>ShareSheet</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
Run Code Online (Sandbox Code Playgroud) 我收到错误,无法读取数据,因为格式不正确.现在我正在通过swift制作iPhone应用程序.我在我的应用程序的Info.plist中添加了几个代码,我删除了这些代码.但是,当我想打开我的应用程序的Info.plist时,会发生此错误.我不知道为什么,因为我删除了我添加的所有代码.我认为格式确实是固定的.我的Info.plist就像
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UILaunchStoryboardName</key>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
如本技术问答所述:
默认情况下,一旦您的应用程序创建OpenGL上下文(通过直接调用OpenGL或依赖OpenGL的API,如Core Animation,Core Image等),MacBook Pro会自动切换到更高端的独立GPU以解决性能问题.在应用程序退出之前不会切换回来.
有办法防止这种情况吗?较新的MacBook Pro上的独立GPU浪费电力并缩短电池寿命.
简单地NSSupportsAutomaticGraphicsSwitching在Info.plist中插入密钥(在技术问答中建议)显然是不够的.
我正在尝试编写两个单独的可提交应用程序:一个用于iPad,另一个用于iPhone.这需要有两个单独的plist,以允许独立指定不同的应用程序图标,启动图像等.
当我尝试重命名我的Info.plist时,MonoDevelop会自动创建一个新的空Info.plist并使用它.出于同样的原因,我似乎无法将我的Info.plist移动到iPad /子文件夹并让MD在那里接收它.
目前我们在一个解决方案中有3个项目:iPad,iPhone,通用文件和库.
唯一的解决方案是在相应的子文件夹中包含单独的.sln文件,还是我还能以某种方式从一个.sln构建两个独立的应用程序?
编辑:项目结构如下,如果这有助于可视化问题.
MyApp.sln MyApp-iPad.csproj MyApp-iPhone.csproj MyApp-Common.csproj Main.cs AppDelegate-iPad.cs AppDelegate-iPhone.cs Info.plist (MD currently uses this for both projects) Common/ iPad/ iPad/Info.plist (for -iPad.csproj) iPhone/ iPhone/Info.plist (for -iPhone.csproj)
info-plist ×10
ios ×7
xcode ×6
objective-c ×2
app-store ×1
cocoa ×1
environment ×1
gpu ×1
ios11 ×1
ios5 ×1
localization ×1
macos ×1
monodevelop ×1
osx-lion ×1
xamarin ×1
xamarin.ios ×1
xcode5 ×1
xcode6 ×1