4

我正在探索HealthKit API,並且很驚訝地找不到HKObjectTypeHKSampleType上的name這樣的方法。HealthKit類型的顯示名稱

HealthKit中是否沒有辦法返回像HKQuantityTypeIdentifierDietaryThiamin這樣的數量的本地化顯示名稱,以便第三方應用程序使用相同的字符串來表示健康應用程序的類型?我們是否應該自行轉換這些醫療術語?

+0

Swift或Objective C? – 2014-09-29 16:45:31

+0

'HKQuantityTypeIdentifierDietaryThiamin'似乎是一個字符串。不是枚舉。那個字符串是什麼? https://developer.apple.com/library/ios/DOCUMENTATION/HealthKit/Reference/HealthKit_Constants/index.html#//apple_ref/doc/constant_group/Nutrition_Identifiers – 2014-09-29 16:52:19

+0

該字符串與標識符相同:@「HKQuantityTypeIdentifierDietaryThiamin」 – Steveo 2014-09-29 16:58:01

回答

3

據我所知,目前HealthKit(至於IOS 8.0.2)沒有一個這樣的事情的直接API。基本上,開發人員有責任定位樣本類型的名稱以及單位。 (儘管有相關的工具來定位單位)。

0

此時,沒有用於直接訪問這種類型的api。欲瞭解更多信息,請查看http://eriphonedeveloper.wordpress.com/2014/09/30/a-soft-touch-of-apple-healthkit-healthkit-tutorial/

+0

鏈接已經死了☠️ – Lewis42 2017-08-24 11:10:08

+0

https://appengineer.in/2014/09/30/a-soft-touch-of-apple-healthkit-healthkit-tutorial/ – 2017-12-04 14:26:46

+0

我看不到這篇文章有幫助嗎?你能否將相關代碼複製並粘貼到SO中? – Lewis42 2017-12-04 14:29:49