Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- return [courses count];
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
- if (nil==cell){
- cell = [[UITableViewCell alloc]
- initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
- }
- NSString *currentCourseName=[courseKeys objectAtIndex:[indexPath row]];
- [[cell textLabel] setText:currentCourseName];
- NSLog(currentCourseName);
- CGSize size = [cell.textLabel.text sizeWithFont:cell.textLabel.font];
- CGFloat y = cell.contentView.frame.size.height / 2;
- UIView *line = [[UIView alloc] initWithFrame:CGRectMake(5,y,size.width, 3)];
- line.backgroundColor = [UIColor redColor];
- [cell.textLabel addSubview:line];
- return cell;
- }
Advertisement
Add Comment
Please, Sign In to add comment