Skip to content

Instantly share code, notes, and snippets.

@gealgaro
Created September 27, 2012 22:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gealgaro/3796724 to your computer and use it in GitHub Desktop.
Save gealgaro/3796724 to your computer and use it in GitHub Desktop.
TableView Snnipet
- (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