swift等同于下一个代码:
[NSBundle bundleForClass:[self class]]
我需要从测试包加载资源(JSON数据)
swift等同于下一个代码:
[NSBundle bundleForClass:[self class]]
我需要从测试包加载资源(JSON数据)
从未使用过,但我认为应该是这样:
Swift <= 2.x
NSBundle(forClass: self.dynamicType)
Swift 3.x
Bundle(for: type(of: self))