ios - NSPredicate to Search Collection -
I have a tableview with a search bar when I add the item to another array, then I search the table Was able to use NSPredicate:
Now I want to keep the archive together so that a tableView will be able to use the object that has the SelectionRowAtIndexPath item
I like my table view Load:.
(int i = 0; i & lt; [item count]; i ++) {head = [item object endx: indexpath.ro]; LabelName.text = head.DESC;
How can I find the archive for my NSPredicate head. DESC
#pragma mark search results - (zero) filterContentForSearchText: (NSString *) searchText scope: (NSString *) scope {NSPredicate * resultPredicate = [NSPredicate predicateWithFormat: @ "Self included [CD]% @", searchText]; Search Result = [Item is using Filtered Array: Get Results]; }
Currently, I'm getting this exception when I run the code above.
The reason: 'can not be used in / is the operator in the collection & lt; Order: 0x7b22e900 & gt; (No collection) '
I think I understand your question. You want to be able to filter by DESC
property to your item
array (which is a group of head
s). How about blocks using
- (zero) filterContentForSearchText: (NSString *) searchText scope: (NSString *) scope {NSPredicate * resultPredicate = [NSPredicate predicateWithBlock: ^ BOOL (ID evaluatedObject , NSDictionary * binding) {Returning string in [[evaluation object dexc]: search text]; }]; Search Result = [Item is using Filtered Array: Get Results]; }
If your command
object defines DESC
as a @property
(or Otherwise you will be able to access it directly:
- (zero) filterContentForSearchText: (NSString *) searchText scope: (NSString *) scope {NSPredicate * resultPredicate = [NSPredicate predicateWithFormat: @ "self.DESC [CD]% @", search text]; Search Result = [Item is Using Filtered Horse: Get Results]; }
Comments
Post a Comment