草庐IT

EmptyArrayStorage

全部标签

Swift 4.2 : [Swift. _EmptyArrayStorage _getValue:forType:]: 无法识别的选择器

将项目升级到Swift4.2(从4.0转换)后,我遇到了NSInvalidArgumentException异常。2018-09-1915:37:33.253482+0100-beta[3715:1010421]-[Swift._EmptyArrayStorage_getValue:forType:]:unrecognizedselectorsenttoinstance0x107e6c2902018-09-1915:37:33.254312+0100-beta[3715:1010421]***Terminatingappduetouncaughtexception'NSInvalidA

Swift 4.2 : [Swift. _EmptyArrayStorage _getValue:forType:]: 无法识别的选择器

将项目升级到Swift4.2(从4.0转换)后,我遇到了NSInvalidArgumentException异常。2018-09-1915:37:33.253482+0100-beta[3715:1010421]-[Swift._EmptyArrayStorage_getValue:forType:]:unrecognizedselectorsenttoinstance0x107e6c2902018-09-1915:37:33.254312+0100-beta[3715:1010421]***Terminatingappduetouncaughtexception'NSInvalidA

ios - 无法在 iOS 11、Xcode 9 中将类型 'Swift._EmptyArrayStorage' 的值转换为 'NSMutableArray'

看起来我们无法将Swift中的空var数组转换为Objective-C中的NSMutableArray。varadultTravelerModels:[TravelerDataModel]=[]BookDataManger.sharedInstance().arraySelectedAdultPassenager=adultTravelerModelsas!NSMutableArray/*(lldb)poadultTravelerModels0elements*/系统版本为iOS11.0,Xcode9.0。我们如何解决这个问题? 最佳答案