Skip to content

Instantly share code, notes, and snippets.

@kgleeson
Created October 28, 2013 20:47
Show Gist options
  • Select an option

  • Save kgleeson/7204388 to your computer and use it in GitHub Desktop.

Select an option

Save kgleeson/7204388 to your computer and use it in GitHub Desktop.
-(void) createDictionaryFromTimers {
timersDict = [[NSMutableDictionary alloc] init];
NSArray *keys = @[@"name", @"steep", @"brew", @"position"];
for (CTTimer *item in coffeeTimers) {
NSArray *values = @[[item title], [NSNumber numberWithInteger:[item steepTime]], [NSNumber numberWithInteger:[item brewTime]], [item listPosition]];
NSMutableDictionary *timerDict = [NSMutableDictionary dictionaryWithObjects:values
forKeys:keys];
[timersDict setValue:timerDict
forKey:[NSString stringWithFormat:@"%@", [item listPosition]]];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment