0
我想從實體中提取對象,其實體數據庫中提供的startDate
或endDate
大於日期 。我目前正在使用IN謂詞如下NDSredicate with IN for NSDate
,
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K IN %@ OR %K in %@", kEntityEventAttributeStartDate, inArray, kEntityEventAttributeEndDate, inArray];
request setPredicate:predicate];
但我認爲它會檢查等於日期在哪裏,我想這日期是更大的。
任何想法如何實現這與NSPredicate
。
在此先感謝。
你的意思是「startDate大於數組中的日期」?它應該大於數組中的所有值嗎? –
爲什麼你有一個日期數組來檢查,如果'startDate'和'endDate'必須大於它們全部?難道你不能只用最大的日期,並用'%K>%@'與它比較嗎? – Greg
並非所有值都大於至少一個值 –