开发者

xCode/iOS Search on multiple criteria

开发者 https://www.devze.com 2023-03-08 18:26 出处:网络
I have an iPhone project that has a word and its translation. I can search using either one or the other, using something like:

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 = @"t开发者_运维知识库ranslation";

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

Is this possible, and if so, how?

Thanks..


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消