数组中搜索字符串出错

时间:2015-03-22 04:47:54

标签: ios iphone object

这是我的阵列:

<__NSArrayI 0x7ae43cd0>(
Regular,
Ultra
)

我正在搜索数组:

- (void)textFieldDidChange:(UITextField *)textField
{
    NSPredicate *pred =[NSPredicate predicateWithFormat:@"name beginswith[c] %@", textField.text];
    NSArray *filteredArr = [[[[arryService objectAtIndex:0] valueForKey:@"Category"] filteredArrayUsingPredicate:pred] mutableCopy];
    NSLog(@"%@",filteredArr);
}

但它崩溃了@

NSArray *filteredArr = [[[[arryService objectAtIndex:0] valueForKey:@"Category"] filteredArrayUsingPredicate:pred] mutableCopy];

为什么会这样?

0 个答案:

没有答案