Using (class) properties

This commit is contained in:
Michael Starke
2018-09-25 11:16:33 +02:00
parent bfe08b5510
commit 009d198421
2 changed files with 9 additions and 8 deletions

View File

@@ -42,10 +42,10 @@
- (void)registerNotificationsForDocument:(MPDocument *)document {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didAddGroup:)
name:MPDocumentDidAddGroupNotification
object:document];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(_didAddGroup:)
name:MPDocumentDidAddGroupNotification
object:document];
}
- (void)viewDidAppear {
@@ -129,8 +129,8 @@
options:nil];
}
- (IBAction)toggleExpire:(NSButton*)sender {
KPKGroup *group = [self representedObject];
if([sender state] == NSOnState && [group.timeInfo.expirationDate isEqualToDate:[NSDate distantFuture]]) {
KPKGroup *group = self.representedObject;
if(sender.state == NSOnState && [group.timeInfo.expirationDate isEqualToDate:NSDate.distantFuture]) {
[NSApp sendAction:self.expireDateSelectButton.action to:nil from:self.expireDateSelectButton];
}
}
@@ -139,7 +139,8 @@
- (void)_didAddGroup:(NSNotification *)notification {
if(!self.titleTextField.window) {
self.focusTitleOnceViewAppears = true;
} else {
}
else {
[self.titleTextField becomeFirstResponder];
}
}

View File

@@ -53,7 +53,7 @@
}
- (void)awakeFromNib {
NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
NSUserDefaultsController *defaultsController = NSUserDefaultsController.sharedUserDefaultsController;
NSString *enableGlobalAutotypeKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableGlobalAutotype];
NSString *quicklookKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableQuicklookPreview];
[self.enableGlobalAutotypeCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil];