NSPredicate case-insensitive matching on to-many relationship

后端 未结 5 1552
攒了一身酷
攒了一身酷 2020-12-07 09:48

I am implementing a search field where the user can type in a string to filter the items displayed in a view. Each object being displayed has a keywords to-man

5条回答
  •  离开以前
    2020-12-07 10:17

    If you is trying to catch only the equals names but with insensitive case, I think it is the best solution

    [NSPredicate predicateWithFormat:@"ANY keywords.name LIKE[c] %@", ...];
    

    You helped me a lot. Thanks guys!!!

    In my case I did:

    [NSPredicate predicateWithFormat:@"ANY name LIKE[c] %@", @"teste"];
    

提交回复
热议问题