나는 내 아이폰의 건강 가치를 객관적인 C 앱에서 읽고있다. 지난 10 일간의 읽기만 필요하지만이 작업을 수행하기위한 쿼리를 수행 할 수는 없습니다.헬스 키트로 지난 10 일간의 기간은 어떻게됩니까?
이 코드와 술어로 쿼리를 추가하려고 해요 :
NSPredicate *explicitforDay =
[NSPredicate predicateWithFormat:@"%K >= %@ AND %K <= %@",
HKPredicateKeyPathDateComponents, startDateComponents,
HKPredicateKeyPathDateComponents, endDateComponents];
그리고 나는 노력이 :
NSPredicate *explicitforDay = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"%@ < %%@ AND %@ >= %%@", HKPredicateKeyPathStartDate
, HKPredicateKeyPathEndDate], myFirstDate, myEndDate];
하지만 출력이 같은 일부 볼 수 있습니다
를(startDate <) CAST (529279732.871222, "NSDate") 및 endDate> = CAST (527983732.871222, "NSDate"))
왜 CAST 및 잘못된 날짜 값이 인쇄됩니까? 감사합니다.
코드에서 인쇄 명령이나 날짜의 실제 값을 볼 수 없습니다. 따라서 인쇄가 올바른지 여부는 말하기 어렵습니다. –