Permalink
Browse files

Replacing more string defines in Obj-C code with const NSString objects.

  • Loading branch information...
1 parent 463734d commit 46977d9c7ac6e5fffc5729c4c32c3c1cc5a963b2 Jan Weiß committed Aug 31, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 EditPaneTextView.m
View
@@ -12,6 +12,7 @@
#import "PreferencesController.h"
NSString * const kEditPaneTextViewChangedNotification = @"EditPaneTextViewChangedNotification";
+NSString * const kEditPaneColorChangedNotification = @"EditPaneColorChangedNotification";
@implementation EditPaneTextView
@@ -26,19 +27,19 @@ - (void)awakeFromNib {
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneForegroundColor]
options:0
- context:@"ColorChange"];
+ context:kEditPaneColorChangedNotification];
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneBackgroundColor]
options:0
- context:@"ColorChange"];
+ context:kEditPaneColorChangedNotification];
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneSelectionColor]
options:0
- context:@"ColorChange"];
+ context:kEditPaneColorChangedNotification];
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneCaretColor]
options:0
- context:@"ColorChange"];
+ context:kEditPaneColorChangedNotification];
[self setUsesFontPanel:NO];
@@ -106,7 +107,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
#pragma unused(object)
#pragma unused(change)
- if ([(NSString *)context isEqualToString:@"ColorChange"]) {
+ if ([(NSString *)context isEqualToString:kEditPaneColorChangedNotification]) {
[self updateColors];
}
}

0 comments on commit 46977d9

Please sign in to comment.