Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 02ab647

Browse files
committed
[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.
1 parent f81ac3b commit 02ab647

6 files changed

+7
-7
lines changed

shell/platform/darwin/macos/framework/Headers/FlutterDartProject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ FLUTTER_DARWIN_EXPORT
4444
*
4545
* Set this to nil to pass no arguments to the Dart entrypoint.
4646
*/
47-
@property(nonatomic, nullable, strong) NSArray<NSString*>* dartEntrypointArguments;
47+
@property(nonatomic, nullable, copy) NSArray<NSString*>* dartEntrypointArguments;
4848

4949
@end
5050

shell/platform/darwin/macos/framework/Headers/FlutterViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ FLUTTER_DARWIN_EXPORT
115115
* }
116116
* ```
117117
*/
118-
@property(readwrite, nonatomic, nullable) NSColor* backgroundColor;
118+
@property(readwrite, nonatomic, nullable, copy) NSColor* backgroundColor;
119119

120120
@end

shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ - (void)resolveTo:(BOOL)handled;
285285
* Only set in debug mode. Nil in release mode, or if the callback has not been
286286
* handled.
287287
*/
288-
@property(nonatomic) NSString* debugHandleSource;
288+
@property(nonatomic, copy) NSString* debugHandleSource;
289289
@end
290290

291291
@implementation FlutterKeyCallbackGuard {

shell/platform/darwin/macos/framework/Source/FlutterKeyPrimaryResponder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ typedef void (^FlutterAsyncKeyCallback)(BOOL handled);
3131
* deriving logical keys.
3232
*/
3333
@required
34-
@property(nonatomic) NSMutableDictionary<NSNumber*, NSNumber*>* _Nullable layoutMap;
34+
@property(nullable, nonatomic, copy) NSMutableDictionary<NSNumber*, NSNumber*>* layoutMap;
3535

3636
@end

shell/platform/darwin/macos/framework/Source/FlutterKeyboardManagerTest.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ - (void)respondTextInputWith:(BOOL)response;
211211
- (void)recordCallTypesTo:(nonnull NSMutableArray<NSNumber*>*)typeStorage
212212
forTypes:(uint32_t)typeMask;
213213

214-
@property(nonatomic) FlutterKeyboardManager* manager;
215-
@property(nonatomic) NSResponder* nextResponder;
214+
@property(readonly, nonatomic, strong) FlutterKeyboardManager* manager;
215+
@property(nullable, nonatomic, strong) NSResponder* nextResponder;
216216

217217
#pragma mark - Private
218218

shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ - (void)setPlatformNode:(flutter::FlutterTextPlatformNode*)node;
1818

1919
@interface FlutterTextFieldMock : FlutterTextField
2020

21-
@property(nonatomic) NSString* lastUpdatedString;
21+
@property(nullable, nonatomic, copy) NSString* lastUpdatedString;
2222
@property(nonatomic) NSRange lastUpdatedSelection;
2323

2424
@end

0 commit comments

Comments
 (0)