Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created September 9, 2010 20:49
Show Gist options
  • Save benlangfeld/572547 to your computer and use it in GitHub Desktop.
Save benlangfeld/572547 to your computer and use it in GitHub Desktop.
- (CPView)tableView:(CPTableView)aTableView dataViewForTableColumn:(CPTableColumn)aTableColumn row:(int)aRow
{
var conversation = [conversations allValues][aRow],
pending = [[EKActivityIndicatorView alloc] initWithFrame:CGRectMake(0,0,10,10)],
ringing = [[EKActivityIndicatorView alloc] initWithFrame:CGRectMake(0,0,10,10)],
value;
[pending setColor:[CPColor redColor]];
[ringing setColor:[CPColor greenColor]];
switch ([aTableColumn identifier])
{
case @"actionStatus":
if ([conversation actionOutstanding] === YES)
{
CPLog.error("Setting action status column to pending.");
value = pending;
}
else if ([conversation status] === @"requested" || [conversation status] === @"created")
{
CPLog.error("Setting action status column to ringing.");
value = ringing;
}
break;
case nil:
break;
default:
value = [aTableColumn dataView];
break;
}
return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment