Skip to content

Instantly share code, notes, and snippets.

@ryanhanwu
Created June 28, 2012 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ryanhanwu/3009037 to your computer and use it in GitHub Desktop.
Save ryanhanwu/3009037 to your computer and use it in GitHub Desktop.
Cell comparasion
Reward* reward = [merchantRewardList objectAtIndex:indexPath.row];
CreditData* currentCreditData = [CreditData dataWithDictionary:[checkInData objectForKey:@"credit"]];
//
[cell setSelectable:YES]; //Every item can be exchange default
//
if ([currentCreditData.points compare: reward.rewardPoints] == NSOrderedAscending) { //Insufficient points
[cell setSelectable:NO];
[cell.rewardName setBackgroundColor:[UIColor purpleColor]];
cell.userInteractionEnabled = NO;
cell.rewardName.
}
cell.rewardName.font = [UIFont fontWithName:@"Dosis-Book" size:20];
cell.rewardName.text = reward.rewardTitle;
cell.exchangePoints.font = [UIFont fontWithName:@"Intro" size:40];
cell.exchangePoints.text = [reward.rewardPoints stringValue];
return cell;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment