From bebfde83a4ed9e5e1c388f6ab08e06697f235e11 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 18 Nov 2022 18:04:48 -0800 Subject: [PATCH] [macOS] Add explicit weak/strong/copy annotations This adds explicit strong/copy Objective-C property annotations where they were previously implied on NSObject properties and fixes on case where it was previously improperly specified. --- .../darwin/macos/framework/Headers/FlutterDartProject.h | 2 +- .../darwin/macos/framework/Headers/FlutterViewController.h | 2 +- .../macos/framework/Source/FlutterEmbedderKeyResponder.mm | 2 +- .../macos/framework/Source/FlutterKeyPrimaryResponder.h | 2 +- .../macos/framework/Source/FlutterKeyboardManagerTest.mm | 4 ++-- .../macos/framework/Source/FlutterTextInputPluginTest.mm | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/shell/platform/darwin/macos/framework/Headers/FlutterDartProject.h b/shell/platform/darwin/macos/framework/Headers/FlutterDartProject.h index e888273c880ca..4a83e4d3e6062 100644 --- a/shell/platform/darwin/macos/framework/Headers/FlutterDartProject.h +++ b/shell/platform/darwin/macos/framework/Headers/FlutterDartProject.h @@ -44,7 +44,7 @@ FLUTTER_DARWIN_EXPORT * * Set this to nil to pass no arguments to the Dart entrypoint. */ -@property(nonatomic, nullable, strong) NSArray* dartEntrypointArguments; +@property(nonatomic, nullable, copy) NSArray* dartEntrypointArguments; @end diff --git a/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h b/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h index 53e26fbad4da6..4dea666e1262c 100644 --- a/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h +++ b/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h @@ -115,6 +115,6 @@ FLUTTER_DARWIN_EXPORT * } * ``` */ -@property(readwrite, nonatomic, nullable) NSColor* backgroundColor; +@property(readwrite, nonatomic, nullable, copy) NSColor* backgroundColor; @end diff --git a/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm b/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm index 1da401c5e7628..5854bb02f35f6 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm @@ -285,7 +285,7 @@ - (void)resolveTo:(BOOL)handled; * Only set in debug mode. Nil in release mode, or if the callback has not been * handled. */ -@property(nonatomic) NSString* debugHandleSource; +@property(nonatomic, copy) NSString* debugHandleSource; @end @implementation FlutterKeyCallbackGuard { diff --git a/shell/platform/darwin/macos/framework/Source/FlutterKeyPrimaryResponder.h b/shell/platform/darwin/macos/framework/Source/FlutterKeyPrimaryResponder.h index 8fa599f14ea1f..b61c790028a3b 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterKeyPrimaryResponder.h +++ b/shell/platform/darwin/macos/framework/Source/FlutterKeyPrimaryResponder.h @@ -31,6 +31,6 @@ typedef void (^FlutterAsyncKeyCallback)(BOOL handled); * deriving logical keys. */ @required -@property(nonatomic) NSMutableDictionary* _Nullable layoutMap; +@property(nonatomic, nullable, strong) NSMutableDictionary* layoutMap; @end diff --git a/shell/platform/darwin/macos/framework/Source/FlutterKeyboardManagerTest.mm b/shell/platform/darwin/macos/framework/Source/FlutterKeyboardManagerTest.mm index b5fe0e65626f6..d9b2ba994d7f2 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterKeyboardManagerTest.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterKeyboardManagerTest.mm @@ -211,8 +211,8 @@ - (void)respondTextInputWith:(BOOL)response; - (void)recordCallTypesTo:(nonnull NSMutableArray*)typeStorage forTypes:(uint32_t)typeMask; -@property(nonatomic) FlutterKeyboardManager* manager; -@property(nonatomic) NSResponder* nextResponder; +@property(readonly, nonatomic, strong) FlutterKeyboardManager* manager; +@property(nonatomic, nullable, strong) NSResponder* nextResponder; #pragma mark - Private diff --git a/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm b/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm index 642757abdf6c3..9f4a39d4b3818 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm @@ -18,7 +18,7 @@ - (void)setPlatformNode:(flutter::FlutterTextPlatformNode*)node; @interface FlutterTextFieldMock : FlutterTextField -@property(nonatomic) NSString* lastUpdatedString; +@property(nonatomic, nullable, copy) NSString* lastUpdatedString; @property(nonatomic) NSRange lastUpdatedSelection; @end