i have a tableview. i loaded the rules into the table of search view controller.
when i type character into searchbar how to implement search functionality and how to add it to the rulesArray
.
i have an array 'rulesArray" with all rules like below.
[rulesArray addObject:[rules objectAtIndex:k]];
Rule is a class. Also I want to add rule type to the rulesArray.
How to do both issues?
Code is below:
Rule *bRule;
for(bRule in rulesArray)
{
NSString *name=(NSString *) bTopic;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
NSRange r = [name rangeOfString:searchText options:NSCaseInsensitiveSearch];
if(r.location != NSNotFound)
{
if(r.location== 0)//that is we are checking only the start of the names.
{
[rulesArray addObject:name];
}
}