[macOS] Add explicit weak/strong/copy annotations (flutter/engine#37768)

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.
This commit is contained in:
Chris Bracken
2022-11-21 10:53:18 -08:00
committed by GitHub
parent 1d5b033399
commit d094a6a0f5
6 changed files with 7 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ FLUTTER_DARWIN_EXPORT
*
* Set this to nil to pass no arguments to the Dart entrypoint.
*/
@property(nonatomic, nullable, strong) NSArray<NSString*>* dartEntrypointArguments;
@property(nonatomic, nullable, copy) NSArray<NSString*>* dartEntrypointArguments;
@end

View File

@@ -115,6 +115,6 @@ FLUTTER_DARWIN_EXPORT
* }
* ```
*/
@property(readwrite, nonatomic, nullable) NSColor* backgroundColor;
@property(readwrite, nonatomic, nullable, copy) NSColor* backgroundColor;
@end

View File

@@ -285,7 +285,7 @@ struct FlutterKeyPendingResponse {
* 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 {

View File

@@ -31,6 +31,6 @@ typedef void (^FlutterAsyncKeyCallback)(BOOL handled);
* deriving logical keys.
*/
@required
@property(nonatomic) NSMutableDictionary<NSNumber*, NSNumber*>* _Nullable layoutMap;
@property(nonatomic, nullable, strong) NSMutableDictionary<NSNumber*, NSNumber*>* layoutMap;
@end

View File

@@ -211,8 +211,8 @@ void clearEvents(std::vector<FlutterKeyEvent>& events) {
- (void)recordCallTypesTo:(nonnull NSMutableArray<NSNumber*>*)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

View File

@@ -18,7 +18,7 @@
@interface FlutterTextFieldMock : FlutterTextField
@property(nonatomic) NSString* lastUpdatedString;
@property(nonatomic, nullable, copy) NSString* lastUpdatedString;
@property(nonatomic) NSRange lastUpdatedSelection;
@end