Ios 应用程序错误:Can';在对象上不进行正则表达式匹配

Ios 应用程序错误:Can';在对象上不进行正则表达式匹配,ios,xml,xcode,search,nspredicate,Ios,Xml,Xcode,Search,Nspredicate,我解析XML,我有搜索栏。尝试搜索时,出现以下错误: 无法对对象执行正则表达式匹配 我认为问题在于: - (void) searchTableView { [filteredList superclass]; filteredList = nil; filteredList = [[NSMutableArray alloc] initWithArray:app.listArray]; NSPredicate *predicate = [NSPredicate

我解析XML,我有搜索栏。尝试搜索时,出现以下错误:

无法对对象执行正则表达式匹配

我认为问题在于:

- (void) searchTableView 
{
    [filteredList superclass];
    filteredList = nil;

    filteredList = [[NSMutableArray alloc] initWithArray:app.listArray];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF like[c] %@",[NSString  stringWithFormat:@"%@*",search.text]];
    [filteredList filterUsingPredicate:predicate]; 
}
我是Xcode的初学者

以下是我所有的MasterViewController类:

@implementation MasterViewController
@synthesize app;
@synthesize detailViewController = _detailViewController;
@synthesize theList;
@synthesize filteredList;
@synthesize search;


- (void)viewDidLoad
{
    [super viewDidLoad];
    app = [[UIApplication sharedApplication] delegate];
    filteredList = [[NSMutableArray alloc] initWithArray:app.listArray];
    [self.tableView reloadData];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    //return [app.listArray count];
    return [filteredList count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    theList = [app.listArray objectAtIndex:indexPath.row];
    cell.textLabel.text = theList.znacka;
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{

    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

- (void) searchTableView
{
    [filteredList superclass];
    filteredList = nil;

    filteredList = [[NSMutableArray alloc] initWithArray:app.listArray];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"count=%d",[NSString stringWithFormat:@"%@*",search.text]];
    [filteredList filterUsingPredicate:predicate];


}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    DetailViewController *detailView = [[DetailViewController alloc] init];

    theList = [app.listArray objectAtIndex:indexPath.row];

    detailView.theList = theList;

    [self.navigationController pushViewController:detailView animated:YES];
}
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
    [self searchTableView];
    [self.tableView reloadData];
}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
    [self searchTableView];
    [search resignFirstResponder];
}
@end

我在MasterViewController.xib中有搜索栏。在这里,我有来自XML的五个项目(theList.znacka),现在我需要搜索这些项目。

您能提供更详细的信息或提供更多的代码吗?XML解析与实际问题有什么关系?Thx为了您的评论,我添加了我所有的类MasterViewController。如果您需要,我可以添加一些其他信息或代码;)。我希望,你能帮助我,因为我不知道什么是不好的:(.对不起,我的英语水平很差:我不知道如何帮助我?对不起,我刚刚复习了你的问题,并注意到它可以改进,以帮助有iOS经验的人理解它。我担心你不得不等待。