NSPredicate to match “any entry in an NSDatabase with value that contains a string”

前端 未结 2 1427
一整个雨季
一整个雨季 2020-12-09 13:20

I have an array of dictionaries, similar to the following:

(
        {
            Black = \"?\";
            Date = \"????.??.??\";
            Result = \"*\";
          


        
2条回答
  •  既然无缘
    2020-12-09 14:09

    if you want to match a object in the dictionary the you can do this by using a for loop but it may be a time consuming task -

    for(int i=0; i< [array count]; i++)
    {
    
        NSDictionary *dic = [array objectAtIndex:i];
    
        if([[dic objectForKey:@"Black"] isEqualToString:@"2007"])
        {
        //here is the match
        }
    }
    

提交回复
热议问题