Created
August 8, 2012 03:52
-
-
Save sugendran/3291911 to your computer and use it in GitHub Desktop.
TableView Shortcut - ARC
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 UITableViewDelegate | |
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
[tableView deselectRowAtIndexPath:indexPath animated:YES]; | |
} | |
#pragma mark - | |
#pragma mark UITableViewDataSource | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
return 1; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *cellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; | |
if(cell == nil){ | |
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; | |
} | |
return cell; | |
} | |
#pragma mark - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment