ICL1901
ICL1901

Reputation: 7778

xCode/iOS Search on multiple criteria

I have an iPhone project that has a word and its translation.

I can search using either one or the other, using something like:

tableModel.searchPropertyName = @"word"; or

tableModel.searchPropertyName = @"translation";

I'd like to be able to search based on either.

Is this possible, and if so, how?

Thanks..

Upvotes: 0

Views: 639

Answers (1)

user23743
user23743

Reputation:

If you're using NSPredicate, construct an "and" predicate or "or" predicate that contains both of your searches as subpredicates.

If you're not using NSPredicate, switch to using NSPredicate then follow the first sentence.

Upvotes: 3

Related Questions