country=[[NSMutableArray alloc]initWithObjects:@"Afghanistan",
@"Albania",
@"Algeria",
@"American Samoa",
@"Andorra",
@"Angola",
@"Anguilla",
@"Antigua and Barbuda",
@"Argentina",
@"Armenia",
@"Aruba",
@"Ascension Island",
@"Australia",nil];
NSString *value=@"Al";
NSPredicate * predicate = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@",value];
NSArray *filterValue = [country filteredArrayUsingPredicate:predicate];
我有一个包含国家/地区列表的 NSMutableArray。我尝试使用 NSPredicate 过滤值。它不起作用。我的代码有什么问题?任何帮助都会得到帮助。提前谢谢