load a reusable UITableViewCell from a XIB


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  2. UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"CustomCellId"];
  3. if (cell == nil) {
  4. UIViewController *c = [[UIViewController alloc]
  5. initWithNibName:@"CustomCell" bundle:nil];
  6.  
  7. cell = (PostCell *)c.view;
  8. [c release];
  9. }
  10. return cell;
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.