Xcode 9 crashes when debugging in swift [closed]

末鹿安然 提交于 2019-12-11 07:27:43

问题


I'm using the latest RxSwift library for reactive programming and facing a strange problem when debugging my code in Xcode 9.1! I have a collectionView inside tableView header and bind selectedItem of collectionView to ViewModel variable to filter out section items. But when I change selected item of collectionView Xcode crashes and I can't figure out the problem! Is it related to libraries that I use or it's Xcode bug?


回答1:


Since I had a similar problem, maybe my "solution" will help you as well:

After browsing the RxSwift github issues for a bit I came across this issue: https://github.com/ReactiveX/RxSwift/issues/1463

While not exactly the same, I tried the proposed solution - Bumping the Pods' Optimization level from None to Fast.

That did the trick.

Apparently when installed via CocoaPods and when running in Debug mode RxSwift's asserts not only crash the app but also the IDE itself. At least that's what I got from the whole ordeal. Now, while the proposed solution may not be the technically best one (since we're now seemingly ignoring asserts that may actually be important), it got my code working again.

Screenshot of where and what to set in XCode's project settings



来源:https://stackoverflow.com/questions/47335645/xcode-9-crashes-when-debugging-in-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!