diff --git a/Cocoa/Document.m b/Cocoa/Document.m index 823204c..10ba510 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -646,7 +646,7 @@ static void audioCallback(GB_gameboy_t *gb, GB_sample_t *sample) GB_load_rom(&gb, [self.fileName UTF8String]); GB_load_battery(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"sav"] UTF8String]); GB_load_cheats(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"cht"] UTF8String]); - [self.cheatWindowController.cheatsTable reloadData]; + [self.cheatWindowController cheatsUpdated]; GB_debugger_clear_symbols(&gb); GB_debugger_load_symbol_file(&gb, [[[NSBundle mainBundle] pathForResource:@"registers" ofType:@"sym"] UTF8String]); GB_debugger_load_symbol_file(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"sym"] UTF8String]); diff --git a/Cocoa/GBCheatWindowController.h b/Cocoa/GBCheatWindowController.h index adb0bf8..f70553e 100644 --- a/Cocoa/GBCheatWindowController.h +++ b/Cocoa/GBCheatWindowController.h @@ -12,6 +12,6 @@ @property (weak) IBOutlet NSTextField *importCodeField; @property (weak) IBOutlet NSTextField *importDescriptionField; @property (weak) IBOutlet Document *document; - +- (void)cheatsUpdated; @end diff --git a/Cocoa/GBCheatWindowController.m b/Cocoa/GBCheatWindowController.m index 994d5e1..c10e2a9 100644 --- a/Cocoa/GBCheatWindowController.m +++ b/Cocoa/GBCheatWindowController.m @@ -231,4 +231,10 @@ [self.cheatsTable reloadData]; } +- (void)cheatsUpdated +{ + [self.cheatsTable reloadData]; + [self tableViewSelectionDidChange:nil]; +} + @end