Remove some trivial deprecated symbol usages in iOS Embedder (flutter/engine#42711)
stringWithCString was deprecated in iOS 2.0 UIAccessibilityVoiceOverStatusChanged was deprecated in iOS 11.0 fixes: https://github.com/flutter/flutter/issues/128732 https://github.com/flutter/flutter/issues/128736 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -678,7 +678,7 @@ static constexpr int kNumProfilerSamplesPerSec = 5;
|
||||
// TODO(gaaclarke): Find way to eliminate this data copy.
|
||||
NSData* data = [NSData dataWithBytes:screenshot.data->writable_data()
|
||||
length:screenshot.data->size()];
|
||||
NSString* format = [NSString stringWithCString:screenshot.format.c_str()];
|
||||
NSString* format = [NSString stringWithUTF8String:screenshot.format.c_str()];
|
||||
NSNumber* width = @(screenshot.frame_size.fWidth);
|
||||
NSNumber* height = @(screenshot.frame_size.fHeight);
|
||||
return result(@[ width, height, format, data ]);
|
||||
@@ -821,8 +821,7 @@ static void SetEntryPoint(flutter::Settings* settings, NSString* entrypoint, NSS
|
||||
if (initialRoute != nil) {
|
||||
self.initialRoute = initialRoute;
|
||||
} else if (settings.route.empty() == false) {
|
||||
self.initialRoute = [NSString stringWithCString:settings.route.c_str()
|
||||
encoding:NSUTF8StringEncoding];
|
||||
self.initialRoute = [NSString stringWithUTF8String:settings.route.c_str()];
|
||||
}
|
||||
|
||||
FlutterView.forceSoftwareRendering = settings.enable_software_rendering;
|
||||
|
||||
@@ -342,7 +342,7 @@ typedef struct MouseState {
|
||||
|
||||
[center addObserver:self
|
||||
selector:@selector(onAccessibilityStatusChanged:)
|
||||
name:UIAccessibilityVoiceOverStatusChanged
|
||||
name:UIAccessibilityVoiceOverStatusDidChangeNotification
|
||||
object:nil];
|
||||
|
||||
[center addObserver:self
|
||||
|
||||
@@ -114,7 +114,7 @@ NS_INLINE NSString* _platformName() {
|
||||
char* answer = malloc(size);
|
||||
sysctlbyname("hw.model", answer, &size, NULL, 0);
|
||||
|
||||
NSString* results = [NSString stringWithCString:answer encoding:NSUTF8StringEncoding];
|
||||
NSString* results = [NSString stringWithUTF8String:answer];
|
||||
free(answer);
|
||||
return results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user