我对这个问题发疯了: 我正在使用AQGridView从我从SQLite中检索的数组中显示一些图像,但是我无法使用UISearchBar过滤网格,我将其置于SplitViewController中Detail区域的TitleView中。你可以用一些逻辑段落或一个例子来帮助我吗?
谢谢!
答案 0 :(得分:0)
解决了!
删除所有对象后重新计算数组_icons。
[_icons removeAllObjects];
searching = YES;
NSInteger numeroElem = [subcatList getSize];
for ( NSUInteger i = 0; i < numeroElem; i++ )
{
NSDictionary *itemAtIndex = (NSDictionary *)[subcatList objectAtIndex:i];
NSString *titolo_cat = [itemAtIndex objectForKey:@"titolo"];
NSComparisonResult result = [titolo_cat compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])];
if (result == NSOrderedSame)
{
ETC ETC.......
[_icons addObject: image];
}
};