I have this piece of code
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults objectForKey:@"firstRuns"]){
[defaults setObject:[NSDate date] forKey:@"firstRuns"];
if ([cellValue isEqual: @"First"] || [cellValue isEqual: @"Primo"]){
cell.backgroundColor = [UIColor yellowColor];
} else {
cell.backgroundColor = [UIColor whiteColor];
}
}
[[NSUserDefaults standardUserDefaults] synchronize];
in
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
in order that the background of the row called “Primo” or “First” is set to yellow for the first use of the user.
I want the yellow background to last at least 3 sessions, how can i do that? Thanks
Something like: