diff --git a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate index 68fc9a7..da9b697 100644 Binary files a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate and b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Clocker/Preferences/CLPreferencesViewController.m b/Clocker/Preferences/CLPreferencesViewController.m index 3bb3a35..1ee0dfa 100644 --- a/Clocker/Preferences/CLPreferencesViewController.m +++ b/Clocker/Preferences/CLPreferencesViewController.m @@ -411,6 +411,8 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?"; { CLTimezoneData *dataObject = self.filteredArray[self.availableTimezoneTableView.selectedRow]; + /* + [self.selectedTimeZones enumerateObjectsUsingBlock:^(NSData * _Nonnull encodedData, NSUInteger idx, BOOL * _Nonnull stop) { @@ -434,6 +436,8 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?"; }]; + + */ if (self.messageLabel.stringValue.length == 0) @@ -511,8 +515,6 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?"; - (IBAction)removeFromFavourites:(id)sender { - NSMutableArray *itemsToRemove = [NSMutableArray array]; - if (self.timezoneTableView.selectedRow == -1) { return; @@ -530,12 +532,10 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?"; } - [itemsToRemove addObject:self.selectedTimeZones[idx]]; + [self.selectedTimeZones removeObjectAtIndex:idx]; }]; - [self.selectedTimeZones removeObjectsInArray:itemsToRemove]; - NSMutableArray *newDefaults = [[NSMutableArray alloc] initWithArray:self.selectedTimeZones]; [[NSUserDefaults standardUserDefaults] setObject:newDefaults forKey:CLDefaultPreferenceKey]; @@ -644,11 +644,11 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?"; } --(BOOL)tableView:(NSTableView *)tableView acceptDrop:(id)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation +-(BOOL)tableView:(NSTableView *)tableView acceptDrop:(id)info row:(NSInteger)destinationRow dropOperation:(NSTableViewDropOperation)dropOperation { - if (row == self.selectedTimeZones.count) + if (destinationRow == self.selectedTimeZones.count) { - row--; + destinationRow--; } NSPasteboard *pBoard = [info draggingPasteboard]; @@ -657,7 +657,7 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?"; NSIndexSet *rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:data]; - [self.selectedTimeZones exchangeObjectAtIndex:rowIndexes.firstIndex withObjectAtIndex:row]; + [self.selectedTimeZones exchangeObjectAtIndex:rowIndexes.firstIndex withObjectAtIndex:destinationRow]; [[NSUserDefaults standardUserDefaults] setObject:self.selectedTimeZones forKey:CLDefaultPreferenceKey];