1
我試圖用以下謂詞來搜索日曆事件,但我發現了以下 異常「NSInvalidArgumentException」,原因是:如何創建NSPredicate以在日曆中搜索事件?
//[_sender objectAtIndex:0] is Name of the event and [_sender objectAtIndex:1] is location of the event NSPredicate *prediction=[NSPredicate predicateWithFormat:@"(SELF contains[cd] %@)", [NSString stringWithFormat: @"%@%@",[_sender objectAtIndex:0],[_sender objectAtIndex:1]]]; NSArray*events=[eventStore eventsMatchingPredicate:prediction];