Bug 14027 - Information Property List Keys unavailable
Summary: Information Property List Keys unavailable
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.9.5.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-08-16 08:25 UTC by kissling
Modified: 2016-03-11 20:27 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description kissling 2013-08-16 08:25:39 UTC
When accessing Info.plist keys programmatically using NSBundle.MainBundle.ObjectForInfoDictionary, the corresponding Core Foundation Keys do not seem to be exposed to the Xamarin wrappers. 

https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070 

I would suggest that these keys would be added to NSBundle for easier access.

Otherwise, strings have to be typed manually, which is error prone.

string identifier = new NSString(NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleIdentifier").Handle);

Xamarin Version Information:


=== Xamarin Studio ===

Version 4.1.9 (build 6)
Installation UUID: 938751df-f7a5-457d-b87b-379763e0ada1
Runtime:
	Mono 3.2.1 ((no/f3f789e)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302010001

=== Apple Developer Tools ===

Xcode 5.0 (3329.43)
Build 5A11365x

=== Xamarin.iOS ===

Version: 6.9.5.67 (Business Edition)
Hash: 518899b
Branch: 
Build date: 2013-02-08 08:57:25-0400

=== Xamarin.Android ===

Version: 4.8.2 (Business Edition)
Android SDK: /Users/***/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 401090006
Git revision: 123fc693ab9ba2690f93fcfe2cd3499335049ff4
Build date: 2013-08-06 15:11:38+0000
Xamarin addins: ad4a498b75333e43547e87574c1ec8c7cae05de0

=== Operating System ===

Mac OS X 10.8.4
Darwin ***.local 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Comment 1 Sebastien Pouliot 2016-03-11 20:27:15 UTC
An easier, less error prone, way to get this is to do:

> string id = (NSString) NSBundle.MainBundle.InfoDictionary ["CFBundleIdentifier"];

and does not requires exposing additional constants.