X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=ConfigsController.m;h=4227d436a616bcbe43eb0229eba1b6a22486ecd6;hp=dbb2c6f063c4b9e1df5a6fcd5db0b63016a1f89d;hb=320e3065d251e11370e571df5705675937b76521;hpb=c262a3d0972ba16257fd24a948ab04f528f80d33 diff --git a/ConfigsController.m b/ConfigsController.m index dbb2c6f..4227d43 100644 --- a/ConfigsController.m +++ b/ConfigsController.m @@ -24,8 +24,7 @@ - (id)init { if ((self = [super init])) { configs = [[NSMutableArray alloc] init]; - currentConfig = [[Config alloc] init]; - currentConfig.name = @"(default)"; + currentConfig = [[Config alloc] initWithName:@"(default)"]; manualConfig = currentConfig; [configs addObject:currentConfig]; } @@ -60,8 +59,7 @@ } - (IBAction)addPressed:(id)sender { - Config *newConfig = [[Config alloc] init]; - newConfig.name = @"untitled"; + Config *newConfig = [[Config alloc] initWithName:@"Untitled"]; [configs addObject:newConfig]; [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged]; [tableView reloadData]; @@ -139,8 +137,7 @@ // have to do two passes in case config1 refers to config2 via a TargetConfig for (NSDictionary *storedConfig in storedConfigs) { - Config *cfg = [[Config alloc] init]; - cfg.name = storedConfig[@"name"]; + Config *cfg = [[Config alloc] initWithName:storedConfig[@"name"]]; [newConfigs addObject:cfg]; }