XCode 自动更新,重启后我发现我有很多错误。
这是导致相关错误的代码:
let navBarTextAttributes = NSMutableDictionary.dictionaryWithCapacity(1)
navBarTextAttributes.setObject(UIColor.whiteColor(), forKey: NSForegroundColorAttributeName)
navigationController?.navigationBar.titleTextAttributes = navBarTextAttributes
}
我不确定如何解决这个问题。
谁能给我一些见解?
感谢您的宝贵时间。
最佳答案
Objective-C 类(工厂)方法现在作为自定义初始化程序导入到 Swift 中:
let navBarTextAttributes = NSMutableDictionary(capacity: 1)
关于ios - XCode 版本 6.1 (6A1052d) 更新导致错误 : 'dictionaryWithCapacity' has been explicitly marked unavailable here (Foundation. NSMutableDictionary),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27189674/