UITable delegates


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



Copy this code and paste it in your HTML
  1. #pragma mark -
  2. #pragma mark Table View Data Source
  3.  
  4. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  5. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"singleCell"];
  6.  
  7. if (cell == nil) {
  8. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"singleCell"];
  9. cell.selectionStyle = UITableViewCellSelectionStyleBlue;
  10. cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
  11. }
  12.  
  13. return cell;
  14. }
  15.  
  16. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  17. return 1;
  18. }
  19.  
  20. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  21. return 1;
  22. }
  23.  
  24. #pragma mark -
  25. #pragma mark Table View Delegate
  26.  
  27. - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  28. return nil;
  29. }
  30.  
  31. - (NSIndexPath *)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  32. return nil;
  33. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.