Unable to Populate TableView In PopOverController - Objective C

前端 未结 4 643
一生所求
一生所求 2021-01-26 11:59

I have a UIButton called as UploadButton. I am using the following lines of code which takes care of the action which should happen on clicking it ::

4条回答
  •  不要未来只要你来
    2021-01-26 12:58

    Have you allocated your cell i think by your code it will return nill

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
     static NSString *CellIdentifier = @"Cell";
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
     if(cell == nill){
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];  
    }     
     // Configure the cell...
    
     NSString *key1 = [keys1 objectAtIndex:indexPath.row];
     cell.textLabel.text = key1;
    
     return cell;
    }
    

    may this will help you...

提交回复
热议问题