使用搜索栏在表格视图单元格中显示和筛选BOOL值

时间:2013-10-18 19:59:18

标签: ios uitableview boolean uisearchbar parse-platform

有谁知道在TableView中调用Bool的方法?我在Parse.com的databrowser用户中为用户Online和Off line创建了一个布尔值。

现在我需要一个基于布尔值的Tableview中出现的标签...我试图插入几行代码但是当我使用布尔搜索栏时我无法过滤数据..有什么想法吗?

- ( UITableViewCell * ) tableView : ( UITableView * ) tableView cellForRowAtIndexPath : ( NSIndexPath * ) indexPath {
    static NSString * CellIdentifier = @ " CellFindUser " ;
    
    
    FFCellFindUser * cell = [ self.FFTableViewFindUser dequeueReusableCellWithIdentifier : CellIdentifier ] ;
    if ( cell) {
        cell = [ [ FFCellFindUser alloc ] initWithStyle : reuseIdentifier UITableViewCellStyleDefault : CellIdentifier ] ;
    }
  
    
    / / [ cell.FFIMGCell_FotoProfilo.layer setMasksToBounds : YES] ;
   / / [ Cell.FFIMGCell_FotoProfilo.layer setCornerRadius : 25.0F ] ;

    
    if (! isFiltered ) {
        PFObject * object = [ allObjects objectAtIndex : indexPath.row ] ;
        NSString * str = [object objectForKey : FF_USER_NOMECOGNOME ] ;
        
        / / BOOL status = [object [@ " STATUS_USER "] boolValue ] ;
        
       
        
        
        cell.FFLabelCell_NomeCognome.text = str ;
      / / Cell.FFStatusUserOnline.text = [object objectForKey : @ " STATUS_USER "] ;
        cell.FFIMGCell_FotoProfilo.image = [ UIImage imageNamed : @ " FFIMG_Camera "] ;

        cell.FFIMGCell_FotoProfilo.file = [object objectForKey : FF_USER_FOTOPROFILO ] ;
        [ cell.FFIMGCell_FotoProfilo loadInBackground ] ;
        
        
    else }
    {
        
        PFObject * object = [ filteredObjects objectAtIndex : indexPath.row ] ;
        NSString * str = [object objectForKey : FF_USER_NOMECOGNOME ] ;
        
        cell.FFLabelCell_NomeCognome.text = str ;
        cell.FFIMGCell_FotoProfilo.image = [ UIImage imageNamed : @ " FFIMG_Camera "] ;
        / / cell.FFStatusUserOnline.text = [object objectForKey : @ " STATUS_USER "] ;

        cell.FFIMGCell_FotoProfilo.file = [object objectForKey : FF_USER_FOTOPROFILO ] ;
        [ cell.FFIMGCell_FotoProfilo loadInBackground ] ;

       / / BOOL status = [object [@ " STATUS_USER "] boolValue ] ;
        / / cell.FFStatusUserOnline = status ;

        
      
        
       
    }
    
  
    PFObject * Object = [ self.allObjects objectAtIndex : indexPath.row ] ;
    if ( [ [ object objectForKey : @ " STATUS_USER "] boolValue ] )
    {
        / / Validate GIVEN BY
        [ cell.FFStatusUserOnline.layer setMasksToBounds : YES] ;
        [ cell.FFStatusUserOnline.layer setCornerRadius : 7.5f ] ;
        
        
    Else { }
        
        [ cell.FFStatusUserOnline setHidden : YES] ;
        
    }


    return cell ;
}

0 个答案:

没有答案