应用程序崩溃 - dyld:未找到符号:_OBJC_CLASS _ $ _ UITraitCollection [英] Application crashes with - dyld: Symbol not found: _OBJC_CLASS_$_UITraitCollection

查看:292
本文介绍了应用程序崩溃 - dyld:未找到符号:_OBJC_CLASS _ $ _ UITraitCollection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

dyld: Symbol not found: _OBJC_CLASS_$_UITraitCollection

我引用UITraitCollection的代码中唯一的位置是:

The only place in the code I have reference to the UITraitCollection is:

func loadImages(imageName: NSString) {
    var image: UIImage
    images = NSMutableArray(capacity: 7)
    for i in 0..7 {
        image = UIImage(named:"\(imageName)\(i).png", inBundle:nil, compatibleWithTraitCollection:nil)

        if (image != nil) {
            images.addObject(image)
        }
    }
}


推荐答案

UITraitCollection只是Foundation框架的一部分与ios8。这个错误说的是你的手机的操作系统(7.1.1)在它的库中没有UITraitCollection,这是真的,因为这个类只是ios8 Foundation.framework库的一部分。为了减少应用程序大小,Apple库都在运行时动态加载,因此它们不必与您的应用程序打包在一起,因此您的应用程序只能访问该特定iPhone上的ios7 Foundation.framework。如果你将iPhone升级到ios8,它应该可以工作。

UITraitCollection is only part of the Foundation framework starting with ios8. What this error is saying is that the OS for your phone (7.1.1) doesn't have UITraitCollection in its library, which is true, since this class is only part of the ios8 Foundation.framework library. In order to cut down on app size, the Apple libraries are all dynamically loaded at runtime so they don't have to be packaged with your app, so your app only has access to the ios7 Foundation.framework on that particular iPhone. If you upgrade your iPhone to ios8, it should work.

这篇关于应用程序崩溃 - dyld:未找到符号:_OBJC_CLASS _ $ _ UITraitCollection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆