iOS12??????????????????????????????xcode10??????

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS12??????????????????????????????xcode10??????相关的知识,希望对你有一定的参考价值。

?????????player   ios1   usb   ase   ??????   lang   push   develop   ????????????   

1???Multiple commands produce ???xxx/Info.plist???
2???ios 12??????WiFi??????SSID(wifi??????)???BSSID(mac??????)??????
3???Xcode 10???#import??????????????????????????????????????????
4???[Xcode 10] library not found for -lstdc++.6.0.9
5???[iOS 12.1] ?????????????????????tabbar???????????????????????????
6???webView????????????????????????????????????
7???[iPhone X]StatusBar????????????????????????crash

  • 1???Multiple commands produce ???xxx/Info.plist???
    ??????Xcode 10??????????????????????????????????????????????????????Multiple commands produce ???xxx/Info.plist????????????????????????????????????info.plist?????????
    ???????????????
    ???I??????????????????????????????????????????????????????
    ???II??????????????????
    xcworkspace?????????Xcode?????????File-> Workspace Settings-> Build System-> Legacy Build System???
    xcodeprj?????????Xcode?????????File-> Project Settings-> Build System-> Legacy Build System???

  • 2???iOS 12??????WiFi??????SSID(wifi??????)???BSSID(mac??????)??????
    ???iOS 12????????????????????????????????????WiFi?????????mac?????????????????????????????????????????????????????????????????????????????????WiFi???????????????????????????????????????????????????iOS??????WiFi?????????mac??????+iOS12??????????????????????????????
    ???????????????
    ???????????????????????????????????????App ID???Access WiFi Infomation?????????
    ???Xcode???Capabilities?????????????????????Access WiFi Infomation?????????

  • 3???Xcode 10???#import??????????????????????????????????????????
    ???Xcode 10???????????????#import????????????/????????????????????????Xcode?????????????????????#import??????????????????????????????
    ???????????????
    xcworkspace?????????Xcode?????????File-> Workspace Settings-> Build System-> Legacy Build System???
    xcodeprj?????????Xcode?????????File-> Project Settings-> Build System-> Legacy Build System???

  • 4???[Xcode 10] library not found for -lstdc++.6.0.9
    ?????????Xcode 10???iOS 12????????????libstdc++?????????libc++??????????????????????????????????????????libstdc++????????????????????????5????????????????????????????????????llvm???????????????????????????C++11???libc++????????????Xcode 10???libstdc++?????????3?????????libstdc++???libstdc++.6???libstdc++6.0.9???????????????????????????????????????
    ???????????????
    ???I????????????????????????libc++
    ??????c++????????????TARGETS-> Build Phases-> Link Binary With Libraries?????????stdc++.6.0.9???????????????libc++.tdb???TARGETS-> Build Settings-> Other Linker Flags?????????-l "stdc++.6.0.9"????????????????????????libc++???
    ???II??????Xcode 9?????????libstdc++???Xcode 10??????
    ??????Xcode 9??????libstdc++?????????copy???Xcode 10???lib????????????????????????????????????????????????????????????????????????????????????????????????

    cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
    
    cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
    ????????????
  • 5???[iOS 12.1] ?????????????????????tabbar???????????????????????????
    iOS 12.1?????????UINavigationController+UITabBarController???UITabBar??????????????????pushViewController???????????????hidesBottomBarWhenPushed = YES???????????????popViewController:animated???????????????????????????????????????????????????tabbar??????????????????????????????????????????????????????????????????????????????????????????UITabBar???????????????????????????????????????tabBar????????????UITabBarButton?????????????????????frame???frame.size????????? (0, 0) ???
    ??????????????????????????????

    [[UITabBar appearance].translucent = NO;
    ????????????
  • 6???webView????????????????????????????????????
    ?????????????????????window??????KeyWindow?????????????????????UIStatusBar???
    ???????????????

    - (void)videoPlayerFinishedToShowStatusBar
    {
        if (@available(iOS 12.0, *)) {
            [[NSNotificationCenter defaultCenter] addObserverForName:UIWindowDidBecomeKeyNotification
                                                            object:self.window
                                                             queue:[NSOperationQueue mainQueue]
                                                        usingBlock:^(NSNotification * _Nonnull note) {
                                                            [[UIApplication sharedApplication] setStatusBarHidden:NO
                                                                                                    withAnimation:UIStatusBarAnimationNone];
                                                        }];
        }
    }
    ????????????
  • 7???[iPhone X]StatusBar????????????????????????crash
    ??????17??????????????????????????????????????????????????????StatusBar??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????iPhone X (Xs,Xs Max,XR)???????????????????????????
    ???????????????????????????????????????????????????iPhone X (Xs,Xs Max,XR)??? ?????????????????????????????????

    crash log???
    *** Terminating app due to uncaught exception ???NSUnknownKeyException???,
    reason: ???[<UIStatusBar_Modern 0x7ffbf2c05670> valueForUndefinedKey:]:
    this class is not key value coding-compliant for the key foregroundView.???
    ????????????

    ????????????????????????????????????

    - (NSString *)getiPhoneNetWorkStates
    {
        UIApplication *app = [UIApplication sharedApplication];
        NSString *states = @"UnKnow";
        NSArray *subViews = [[[app valueForKeyPath:@"statusBar"] valueForKeyPath:@"foregroundView"] subviews];
        for (id child in subViews) {
            if ([child isKindOfClass:NSClassFromString(@"UIStatusBarDataNetworkItemView")]) {
                int networkType = [[child valueForKeyPath:@"dataNetworkType"] intValue];
                NSString *networkStatus = @"UnKnow";
                switch (networkType) {
                    case 0:
                        networkStatus = @"UnKnow";
                        break;
                    case 1:
                        networkStatus = @"2G";
                        break;
                    case 2:
                        networkStatus = @"3G";
                        break;
                    case 3:
                        networkStatus = @"4G";
                        break;
                    case 4:
                        networkStatus = @"LTE";
                        break;
                    case 5:
                        networkStatus = @"WiFi";
                        break;
                    default:
                        break;
                }
            }
        }
        return states;
    }
    ????????????

    ???????????????????????????StatusBar?????????????????????????????????????????????5?????????foregroundView????????????foregroundView????????????
    ???????????????
    iPhone X?????????StatusBar????????????????????????WiFi?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Reachability???

    - (NSString *)getiPhoneNetWorkStates
    {
        UIApplication *app = [UIApplication sharedApplication];
        NSString *states = @"UnKnow";
        id statusBar = [app valueForKeyPath:@"statusBar"];
        if ([self checkDeviceIsiPhoneX]) {
            if ([statusBar isKindOfClass:NSClassFromString(@"UIStatusBar_Modern")]) {
                id curData = [statusBar valueForKeyPath:@"statusBar.currentData"];
                BOOL wifiEnable = [[curData valueForKeyPath:@"_wifiEntry.isEnabled"] boolValue];
                BOOL cellEnable = [[curData valueForKeyPath:@"_cellularEntry.isEnabled"] boolValue];
                // iPhone X?????????StatusBar????????????????????????WiFi???????????????
                // ?????????????????????????????????????????????????????????????????????
                if (wifiEnable) {
                    states = @"WiFi";
                } else if (cellEnable) {
                    states = @"Cellular";
                }
            }
        } else {
            NSArray *subViews = [[statusBar valueForKeyPath:@"foregroundView"] subviews];
            for (id child in subViews) {
                if ([child isKindOfClass:NSClassFromString(@"UIStatusBarDataNetworkItemView")]) {
                    int networkType = [[child valueForKeyPath:@"dataNetworkType"] intValue];
                    switch (networkType) {
                        case 0:
                            states = @"UnKnow";
                            break;
                        case 1:
                            states = @"2G";
                            break;
                        case 2:
                            states = @"3G";
                            break;
                        case 3:
                            states = @"4G";
                            break;
                        case 4:
                            states = @"LTE";
                            break;
                        case 5:
                            states = @"WiFi";
                            break;
                        default:
                            break;
                    }
                }
            }
        }
        return states;
    }

?????????CircusJonathan
?????????https://juejin.im/post/5c825bd35188257ddb6af21a
???????????????
??????????????????????????????????????????????????????????????????????????????????????????????????????

以上是关于iOS12??????????????????????????????xcode10??????的主要内容,如果未能解决你的问题,请参考以下文章

iOS 13 位置权限 - 从 iOS 12 升级后的行为是啥

iOS 12.4.2 上的 iOS 崩溃“无法执行读取 Objective-C 的支持代码”而不是 12.0.1

iOS----------适配iOS12

iOS 12 Safari 的隐私/隐身模式检测

在 iOS 12 中检查设备是不是连接到 ***

iOS12,kReachabilityChangedNotification 不起作用