内容字号:默认大号超大号

段落设置:段首缩进取消段首缩进

字体设置:切换到微软雅黑切换到宋体

Xcode10、iOS12、iPhoneX系列的适配与总结

2018-09-22 20:23 出处:清屏网 人气: 评论(0

1、libstdc++相关的3个库(libstdc++、libstdc++.6、libstdc++.6.0.9)在XCode10和iOS12中被移除

错误描述:
ld: library not found for -lstdc++.6.0.9
linker command failed with exit code 1(use -v to see invocation)

解决办法一:删除libstdc++,编译无错则不用适配,否则参考方法二

解决办法二:拷贝缺失的libstdc++

从XCode 9的目录里,把缺失的.tbd文件拷贝过来,要记得拷贝2套,一套是模拟器的,一套是真机的,文件路径如下:

真机:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib

模拟器:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

2、与第三方的info.plist文件冲突

错误描述:
Showing Recent Messages
:-1: Multiple commands produce '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist':
1) Target 'MMC_SchoolShip' (project 'MMC_SchoolShip') has copy command from '/Users/wzm/Documents/MMC_SchoolShip/MMC_SchoolShip/MMVC/SCHChat/Vender/MJExtension/Info.plist' to '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist'
2) Target 'MMC_SchoolShip' (project 'MMC_SchoolShip') has copy command from '/Users/wzm/Documents/MMC_SchoolShip/MMC_SchoolShip/MMVC/SCHChat/Vender/Masonry/Info.plist' to '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist'
3) Target 'MMC_SchoolShip' (project 'MMC_SchoolShip') has process command with output '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist'

解决办法一:将第三方的info.plist删除

解决办法二:将第三方的info.plist文件重命名且保持唯一

解决办法三:如以上方法出错,参考下图设置Xcode

第一步

第二步

3、项目图标和启动图的调整

Xcode 10如何合理的设置『项目图标』和『启动图』

推荐一款快速生成项目图标的工具: APRO

App Store内搜索下载或 点击下载链接

将生成的图片和Contents.json文件全部拖到对应的文件夹下,即可自动替换。

4、新版屏幕适配

#define IS_iPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define SCREEN_SCALE   [UIScreen mainScreen].scale
#define SCREEN_HEIGHT  [UIScreen mainScreen].bounds.size.height
#define iPhoneX    (IS_iPhone && SCREEN_HEIGHT>=812)  //iPhoneX系列
#define iPhone_5_8 (IS_iPhone && SCREEN_HEIGHT==812)  //5.8寸
#define iPhone_6_1 (IS_iPhone && SCREEN_HEIGHT==896 && SCREEN_SCALE==2.0)  //6.1寸
#define iPhone_6_5 (IS_iPhone && SCREEN_HEIGHT==896 && SCREEN_SCALE==3.0)  //6.5寸

5、自定义创建.framework时的bug修复

Xcode 10创建.framework库文件

分享给小伙伴们:
本文标签: Xcode10iOS12iPhoneX

相关文章

发表评论愿您的每句评论,都能给大家的生活添色彩,带来共鸣,带来思索,带来快乐。

CopyRight © 2015-2016 QingPingShan.com , All Rights Reserved.

清屏网 版权所有 豫ICP备15026204号