Advertisement
Guest User

drellybum

a guest
Oct 1st, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma mark - UITableViewDatasource Methods
  2.  
  3. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  4.     UITableViewCell *cell;
  5.    
  6.     NSObject <CreatorProtocol> *creator = self.cellCreators[indexPath.row];
  7.    
  8.     NSString *cellId = [creator reuseIdentifier];
  9.    
  10.     cell = [tableView dequeueReusableCellWithIdentifier:cellId];
  11.     if (cell == nil) {
  12.         cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
  13.     }
  14.    
  15.     [(NSObject <PSCellProtocol> *)cell setupCellWithCreator:creator];
  16.    
  17.     return cell;
  18. }
  19.  
  20. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  21.     return [self.cellCreators count];
  22. }
  23.  
  24. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  25.     return [(NSObject <CreatorProtocol> *)self.cellCreators[indexPath.row] height];
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement