Realm-cocoa: Realm NSPredicate 'LIKE'

Created on 22 Jan 2016  路  5Comments  路  Source: realm/realm-cocoa

Does Realm support 'LIKE' for NSString properties of models?

T-Help

Most helpful comment

LIKE is not supported by Realm yet. We track adding support for that by #1490. You might be able to use BEGINSWITH, ENDSWITH or CONTAINS meanwhile, which are supported as seen in our NSPredicate cheatsheet.

All 5 comments

*** Terminating app due to uncaught exception 'Invalid operator type', reason: 'Operator 'LIKE' not supported for string type'

LIKE is not supported by Realm yet. We track adding support for that by #1490. You might be able to use BEGINSWITH, ENDSWITH or CONTAINS meanwhile, which are supported as seen in our NSPredicate cheatsheet.

Thank you for really handy cheatsheet.

Cheatsheet includes LIKE which makes it confusing..

The cheatsheet is for NSPredicate in general, but there are pink dots for the queries supported by Realm.

image

Was this page helpful?
0 / 5 - 0 ratings