Last active
August 30, 2015 04:52
-
-
Save dutran90/d5f7c5db0e15fcec7e72 to your computer and use it in GitHub Desktop.
UITableVIew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - UITableView Datasource | |
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ | |
return 1; | |
} | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ | |
return 5; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
static NSString *CellIdentifier = @"ClubCell"; | |
ClubCell *cell = (ClubCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) | |
{ | |
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ClubCell" owner:self options:nil]; | |
cell = (ClubCell *)[nib objectAtIndex:0]; | |
} | |
return cell; | |
} | |
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
return 44; | |
} | |
#pragma mark - Table view delegate | |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |
NSLog(@"Row pressed!!"); | |
} | |
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"]; | |
if (cell == nil) { | |
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"myCell"]; | |
cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
} | |
cell.textLabel.text = self.justCourseNamesArray[indexPath.row]; | |
return cell; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment