【问题标题】:How to Filter Cells in AQGridView with UISearchBar如何使用 UISearchBar 过滤 AQGridView 中的单元格
【发布时间】:2012-04-20 13:54:09
【问题描述】:

我在这个问题上疯了: 我正在使用 AQGridView 显示我从 SQLite 检索的数组中的一些图像,但我无法使用我放入 SplitViewController 中详细区域的 TitleView 的 UISearchBar 过滤网格。你能帮我一些逻辑段落或例子吗?

谢谢!

【问题讨论】:

  • 如果您找到了自己问题的答案,最好将其作为“答案”发布,这样一来就清楚了,您还将获得一个回答自己问题的徽章。跨度>

标签: iphone ios xcode uisearchbar aqgridview


【解决方案1】:

已解决!

删除所有对象后重新计算数组_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];
    }

    };

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-06
    • 2017-07-09
    • 1970-01-01
    • 2011-05-27
    • 2023-03-17
    • 2023-04-07
    相关资源
    最近更新 更多