Pass an NSString
to objectForInfoDictionaryKey
This commit is contained in:
parent
e566a8335f
commit
61c479ebc8
1 changed files with 1 additions and 2 deletions
|
@ -638,8 +638,7 @@ impl platform::Platform for MacPlatform {
|
||||||
if bundle.is_null() {
|
if bundle.is_null() {
|
||||||
Err(anyhow!("app is not running inside a bundle"))
|
Err(anyhow!("app is not running inside a bundle"))
|
||||||
} else {
|
} else {
|
||||||
let version: id =
|
let version: id = msg_send![bundle, objectForInfoDictionaryKey: ns_string("CFBundleShortVersionString")];
|
||||||
msg_send![bundle, objectForInfoDictionaryKey: "CFBundleShortVersionString"];
|
|
||||||
let len = msg_send![version, lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
|
let len = msg_send![version, lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
|
||||||
let bytes = version.UTF8String() as *const u8;
|
let bytes = version.UTF8String() as *const u8;
|
||||||
let version = str::from_utf8(slice::from_raw_parts(bytes, len)).unwrap();
|
let version = str::from_utf8(slice::from_raw_parts(bytes, len)).unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue