我有一个随该方法NSArray返回的 CalEvents 。[CalCalendarStore eventPredicateWithStartDate]从返回的事件中,我试图只保留事件标题 == @"on call"(不区分大小写)的那些。
我可以将标题包含 @"on call"以下代码的事件保留在数组中(其中“事件”是填充有 的“NSArray” CalEvents):
NSPredicate *onCallPredicate = [NSPredicate predicateWithFormat:@"(SELF.title CONTAINS[c] 'on call')"];
[events filteredArrayUsingPredicate:onCallPredicate];
我尝试过使用谓词格式字符串,例如:
@"SELF.title == 'on call'"但这似乎不起作用。
有没有更简单的方法来做到这一点?