
Untitled
By: a guest on
May 16th, 2012 | syntax:
None | size: 0.97 KB | hits: 13 | expires: Never
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *Custom = @"CustomCell";
rowEvent = [arrayEvents objectAtIndex:indexPath.row];
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:Custom];
if (cell == nil) {
UIViewController *c = [[[UIViewController alloc] initWithNibName:Custom bundle:nil] autorelease];
cell = (CustomCell *)c.view;
}
cell.label.text = rowEvent.title;
cell.labelDate.text = [NSString stringWithFormat:@"%@, %@", rowEvent.category, rowEvent.date];
cell.labelLocation.text = rowEvent.place;
UIView* backgroundView = [[UIView alloc] initWithFrame:CGRectZero ];
UIImage* bgImage = [UIImage imageNamed:@"EventCellBackground.png"];
backgroundView.backgroundColor = [[[UIColor alloc] initWithPatternImage: bgImage] autorelease];
cell.backgroundView = backgroundView;
[backgroundView release];
return cell;
}