Created
September 27, 2012 22:03
-
-
Save gealgaro/3796724 to your computer and use it in GitHub Desktop.
TableView Snnipet
This file contains 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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
static NSString *CellIdentifier = @"patientCell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell==nil) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; | |
NSString* letter = [[self sectionsTitlesArray] objectAtIndex:indexPath.section]; | |
NSString* filterString = [NSString stringWithFormat:@"last_name beginswith[cd] '%@'", letter]; | |
NSArray* filteredPatients = [GeneralFunctions filterArrayWithString:filterString objectsToFilter:patients]; | |
cell.textLabel.text = [(Patient *)[filteredPatients objectAtIndex:indexPath.row] fullName]; | |
return cell; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment