let hkSampleType:HKSampleType = HKSampleType.correlationTypeForIdentifier(HKCorrelationTypeIdentifierFood)!
let query = HKSampleQuery(sampleType: hkSampleType, predicate: predicate, limit: 80, sortDescriptors: nil, resultsHandler: { (query:HKSampleQuery, results:[HKSample]!, error:NSError!) -> Void in
//code
})
就是这样,但我收到一个错误:Cannot find an initializer for type 'HKSampleQuery' that accepts an argument list of type '(sampleType: HKSampleType, predicate: NSPredicate, limit: Int, sortDescriptors: nil, resultsHandler: (HKSampleQuery, [HKSample]!, NSError!) -> Void)'
正确的语法将如何?