From 30d6546611549f286dd7b588a5faac06daea135f Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 17 Feb 2023 14:00:37 +0800 Subject: [PATCH] update target ios version to 12 --- build/cocos2d_libs.xcodeproj/project.pbxproj | 4 ++-- cocos/platform/ios/CCApplication-ios.mm | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index fbcc328..8db2c3d 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1926,7 +1926,7 @@ ); GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../external/ios/libs\""; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCC_NEW_RENDERER"; @@ -1973,7 +1973,7 @@ ); GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../external/ios/libs\""; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ""; diff --git a/cocos/platform/ios/CCApplication-ios.mm b/cocos/platform/ios/CCApplication-ios.mm index 65ac087..47f84b6 100644 --- a/cocos/platform/ios/CCApplication-ios.mm +++ b/cocos/platform/ios/CCApplication-ios.mm @@ -335,15 +335,21 @@ void Application::showQRCode(const std::string &content, const std::string &titl NSString *ntitle = [NSString stringWithCString:title.c_str() encoding:NSUTF8StringEncoding]; NSString *ncontent = [NSString stringWithCString:content.c_str() encoding:NSUTF8StringEncoding]; NSString *noid = [NSString stringWithCString:val.c_str() encoding:NSUTF8StringEncoding]; - UIWindow* window = [[[UIApplication sharedApplication] delegate] window]; - [window.rootViewController showRestoreQR:ncontent title:ntitle oid: noid]; + dispatch_async(dispatch_get_main_queue(), ^{ + UIWindow* window = [[[UIApplication sharedApplication] delegate] window]; + [window.rootViewController showRestoreQR:ncontent title:ntitle oid: noid]; + }); + } void Application::saveKeyLocal(const std::string &account, const std::string &key) { NSString *naccount = [NSString stringWithCString:account.c_str() encoding:NSUTF8StringEncoding]; NSString *nkey = [NSString stringWithCString:key.c_str() encoding:NSUTF8StringEncoding]; - UIWindow* window = [[[UIApplication sharedApplication] delegate] window]; - [window.rootViewController saveKey:naccount key: nkey]; + dispatch_async(dispatch_get_main_queue(), ^{ + UIWindow* window = [[[UIApplication sharedApplication] delegate] window]; + [window.rootViewController saveKey:naccount key: nkey]; + }); + } void Application::loadKeyLocal(const std::string &account, std::string *outItem) { @@ -356,7 +362,6 @@ void Application::loadKeyLocal(const std::string &account, std::string *outItem) } else { outItem->assign(""); } - } void Application::toWallet(const std::string &url) {