From 77a775bbce706713e342047fc203a963e019ab32 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 29 Mar 2017 12:48:50 -0400 Subject: [PATCH] Respond to CR. // FREEBIE --- Signal/src/util/ThreadUtil.h | 6 +++-- Signal/src/util/ThreadUtil.m | 4 ++++ .../DebugUITableViewController.m | 22 ++++++++++++++----- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Signal/src/util/ThreadUtil.h b/Signal/src/util/ThreadUtil.h index fd799b052..6c38895c9 100644 --- a/Signal/src/util/ThreadUtil.h +++ b/Signal/src/util/ThreadUtil.h @@ -2,12 +2,12 @@ // Copyright (c) 2017 Open Whisper Systems. All rights reserved. // -#import - @class TSThread; @class OWSMessageSender; @class SignalAttachment; +NS_ASSUME_NONNULL_BEGIN + @interface ThreadUtil : NSObject + (void)sendMessageWithText:(NSString *)text @@ -19,3 +19,5 @@ messageSender:(OWSMessageSender *)messageSender; @end + +NS_ASSUME_NONNULL_END diff --git a/Signal/src/util/ThreadUtil.m b/Signal/src/util/ThreadUtil.m index 096380b13..dcae0fccf 100644 --- a/Signal/src/util/ThreadUtil.m +++ b/Signal/src/util/ThreadUtil.m @@ -10,6 +10,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + @implementation ThreadUtil + (void)sendMessageWithText:(NSString *)text inThread:(TSThread *)thread messageSender:(OWSMessageSender *)messageSender @@ -95,3 +97,5 @@ } @end + +NS_ASSUME_NONNULL_END diff --git a/Signal/src/view controllers/DebugUITableViewController.m b/Signal/src/view controllers/DebugUITableViewController.m index 00776f113..da109a9b9 100644 --- a/Signal/src/view controllers/DebugUITableViewController.m +++ b/Signal/src/view controllers/DebugUITableViewController.m @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @interface OWSTableContents : NSObject @property (nonatomic) NSString *title; -@property (nonatomic) NSMutableArray *sections; +@property (nonatomic) NSMutableArray *sections; @end @@ -23,12 +23,15 @@ NS_ASSUME_NONNULL_BEGIN @implementation OWSTableContents -- (void)addSection:(OWSTableSection *)section { - OWSAssert(section); - - if (!_sections) { +-(instancetype)init { + if (self = [self init]) { _sections = [NSMutableArray new]; } + return self; +} + +- (void)addSection:(OWSTableSection *)section { + OWSAssert(section); [_sections addObject:section]; } @@ -40,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @interface OWSTableSection : NSObject @property (nonatomic) NSString *title; -@property (nonatomic) NSMutableArray *items; +@property (nonatomic) NSMutableArray *items; @end @@ -56,6 +59,13 @@ NS_ASSUME_NONNULL_BEGIN return section; } +-(instancetype)init { + if (self = [self init]) { + _items = [NSMutableArray new]; + } + return self; +} + - (void)addItem:(OWSTableItem *)item { OWSAssert(item);