From 020ba731924f40ec4d9641805dc2d6540878f501 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 9 Sep 2016 17:23:50 +0200 Subject: [PATCH] Clean up. --- Classes/SBApplication.h | 1 - Classes/SBLogWindowController.h | 6 +----- Classes/SBLogWindowController.m | 5 ++++- Classes/SBLogger.h | 6 +----- Classes/SBLogger.m | 9 ++++----- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Classes/SBApplication.h b/Classes/SBApplication.h index 1b72628..3eadb59 100644 --- a/Classes/SBApplication.h +++ b/Classes/SBApplication.h @@ -7,5 +7,4 @@ #import @interface SBApplication : NSApplication - @end diff --git a/Classes/SBLogWindowController.h b/Classes/SBLogWindowController.h index 8eb85ba..1a0226f 100644 --- a/Classes/SBLogWindowController.h +++ b/Classes/SBLogWindowController.h @@ -13,11 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @class SBLogger; -@interface SBLogWindowController : NSWindowController { - @private - NSTextView *__unsafe_unretained _logView; - SBLogger *_logger; -} +@interface SBLogWindowController : NSWindowController - (instancetype)initWithLogger:(SBLogger *)logger; diff --git a/Classes/SBLogWindowController.m b/Classes/SBLogWindowController.m index b1687e8..83a432d 100644 --- a/Classes/SBLogWindowController.m +++ b/Classes/SBLogWindowController.m @@ -10,7 +10,10 @@ #import "SBLogger.h" @interface SBLogWindowController () - +{ + NSTextView *__unsafe_unretained _logView; + SBLogger *_logger; +} @property (nonatomic, unsafe_unretained) IBOutlet NSTextView *logView; @property (nonatomic, readonly) SBLogger *logger; diff --git a/Classes/SBLogger.h b/Classes/SBLogger.h index 8c1056f..d4fd0a4 100644 --- a/Classes/SBLogger.h +++ b/Classes/SBLogger.h @@ -11,15 +11,11 @@ NS_ASSUME_NONNULL_BEGIN -@interface SBLogger : NSObject { - NSURL *_fileURL; - id __unsafe_unretained _delegate; -} +@interface SBLogger : NSObject @property (atomic, unsafe_unretained, readwrite, nullable) id delegate; - (instancetype)initWithLogFile:(NSURL *)fileURL; - - (void)clearLog; @end diff --git a/Classes/SBLogger.m b/Classes/SBLogger.m index f57c813..ddafb40 100644 --- a/Classes/SBLogger.m +++ b/Classes/SBLogger.m @@ -10,6 +10,10 @@ #import "SBLogger.h" @interface SBLogger () +{ + NSURL *_fileURL; + id __unsafe_unretained _delegate; +} @property (nonatomic, readonly) NSURL *fileURL; @@ -17,9 +21,6 @@ @implementation SBLogger -@synthesize fileURL = _fileURL; -@synthesize delegate = _delegate; - - (instancetype)initWithLogFile:(NSURL *)fileURL { self = [self init]; @@ -66,9 +67,7 @@ } - (void)dealloc { - _delegate = nil; - } @end