0

有谁知道在 TableView 中调用 Bool 的方法?我在 Parse.com 的数据浏览器用户中为在线和离线用户创建了一个布尔值。

现在我需要一个基于布尔值出现在 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 ;
}
4

0 回答 0