MaysamSh

Untitled

Mar 24th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  2.     return [courses count];
  3. }
  4.  
  5. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  6.     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
  7.     if (nil==cell){
  8.         cell = [[UITableViewCell alloc]
  9.                                  initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
  10.     }
  11.    
  12.     NSString *currentCourseName=[courseKeys objectAtIndex:[indexPath row]];
  13.     [[cell textLabel] setText:currentCourseName];
  14.     NSLog(currentCourseName);
  15.     CGSize size = [cell.textLabel.text sizeWithFont:cell.textLabel.font];
  16.     CGFloat y = cell.contentView.frame.size.height / 2;
  17.    
  18.     UIView *line = [[UIView alloc] initWithFrame:CGRectMake(5,y,size.width, 3)];
  19.     line.backgroundColor = [UIColor redColor];
  20.     [cell.textLabel addSubview:line];
  21.    
  22.     return cell;
  23.                                  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment