From: Joe Wreschnig Date: Tue, 26 Feb 2013 16:45:38 +0000 (+0100) Subject: Type references to the application delegate to prevent warnings. X-Git-Tag: version-1.0~125 X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=7f9b53485ac2750ac9778b0aaafa62f7bafa251f;p=enjoyable.git Type references to the application delegate to prevent warnings. --- diff --git a/ConfigsController.m b/ConfigsController.m index 43c92d3..01bd0d3 100644 --- a/ConfigsController.m +++ b/ConfigsController.m @@ -48,7 +48,7 @@ currentConfig = config; [removeButton setEnabled: ![config protect]]; [targetController load]; - [[[NSApplication sharedApplication] delegate] configChanged]; + [(ApplicationController *)[[NSApplication sharedApplication] delegate] configChanged]; [tableView selectRow: [configs indexOfObject: config] byExtendingSelection: NO]; } @@ -56,7 +56,7 @@ Config* newConfig = [[Config alloc] init]; [newConfig setName: @"untitled"]; [configs addObject: newConfig]; - [[[NSApplication sharedApplication] delegate] configsChanged]; + [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged]; [tableView reloadData]; [tableView selectRow: ([configs count]-1) byExtendingSelection: NO]; [tableView editColumn: 0 row:([configs count]-1) withEvent:nil select:YES]; @@ -78,7 +78,7 @@ [entries removeObjectForKey: key]; } } - [[[NSApplication sharedApplication] delegate] configsChanged]; + [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged]; [tableView reloadData]; } @@ -99,7 +99,7 @@ [(Config*)[configs objectAtIndex: index] setName: newName]; [targetController refreshConfigsPreservingSelection:YES]; [tableView reloadData]; - [[[NSApplication sharedApplication] delegate] configsChanged]; + [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged]; } -(int)numberOfRowsInTableView: (NSTableView*)table { @@ -170,7 +170,7 @@ configs = newConfigs; [tableView reloadData]; currentConfig = NULL; - [[[NSApplication sharedApplication] delegate] configsChanged]; + [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged]; int index = [[envelope objectForKey: @"selectedIndex"] intValue]; [self activateConfig: [configs objectAtIndex:index] forApplication: NULL]; diff --git a/JoystickController.m b/JoystickController.m index 1551295..1bf5b43 100644 --- a/JoystickController.m +++ b/JoystickController.m @@ -65,7 +65,7 @@ void input_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDVal IOHIDDeviceRef device = IOHIDQueueGetDevice((IOHIDQueueRef) inSender); Joystick* js = [self findJoystickByRef: device]; - if([[[NSApplication sharedApplication] delegate] active]) { + if([(ApplicationController *)[[NSApplication sharedApplication] delegate] active]) { // for reals JSAction* mainAction = [js actionForEvent: value]; if(!mainAction) diff --git a/TargetConfig.m b/TargetConfig.m index 73d4563..dae7786 100644 --- a/TargetConfig.m +++ b/TargetConfig.m @@ -30,7 +30,7 @@ } -(void) trigger { - [[[[NSApplication sharedApplication] delegate] configsController] activateConfig:config forApplication: NULL]; + [[(ApplicationController *)[[NSApplication sharedApplication] delegate] configsController] activateConfig:config forApplication: NULL]; } @end