I just did a HKSourceQuery and got some results. When I do a println
of the results, I got this: <HKSource:0x156c1520 "Health" (com.apple.Health)>//description of the object
How do I use this to make a predicate using the HKQuery.predicateForObjectsFromSource(/* source goes here */)
Here is the sample code in Obj-c,
UPDATE 1:
HKSource
object manually using[HKSource alloc] init]
. In HealthKit framework, Apple restricted creation of objects usinginit
for most of the HK classes.HKSource
object from thesources
set using theHKSource
properties likename
andbundleIdentifier
.Here is the sample code,