次のような NSPredicate があります。
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"entity.name CONTAINS %@", myString];
ただし、その文字列を含むものはすべて返されます。例: 私の entity.name の場合:
text
texttwo
textthree
randomtext
そして、これらmyString
のtext
すべての文字列が一致します。is の場合は名前の最初のオブジェクトのみを返し、myString
is の場合は名前の4 番目のオブジェクトを返すようにしたいと思います。また、大文字と小文字を区別せず、空白を無視することも探していますtext
text
myString
randomtext
randomtext