陈斌彬的技术博客

Stay foolish,stay hungry

viewDidLayoutSubviews在ios7上导致应用崩溃

在iOS8中使用viewDidLayoutSubviews,应用正常运行,没有问题,但是应用在ios7上运行的时候,报错,导致应用崩溃,错误信息类似:

Cannot find executable for CFBundle 0x78f8f220 </Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/GeoServices.axbundle

Assertion failure in -[UIView layoutSublayersOfLayerl]….unrecognizeSelector…..

在viewDidLayoutSubviews方法末尾添加 [self.view layoutsubviews]即可解决