Ios 无法调用';枚举对象';具有类型为';((AnyObject!、NSInteger、unsafemtablepointer<;ObjCBool>;)->;())和#x27;

Ios 无法调用';枚举对象';具有类型为';((AnyObject!、NSInteger、unsafemtablepointer<;ObjCBool>;)->;())和#x27;,ios,iphone,swift,swift3,Ios,Iphone,Swift,Swift3,我的项目在Xcode 8中的这一行中遇到了以下错误,而它在Xcode 7中运行良好 (self.columnHeights[section] as AnyObject).enumerateObjects({(object : AnyObject!, idx : NSInteger,pointer :UnsafeMutablePointer<ObjCBool>) (self.columnHeights[section]作为AnyObject)。枚举对象({(object:AnyOb

我的项目在Xcode 8中的这一行中遇到了以下错误,而它在Xcode 7中运行良好

(self.columnHeights[section] as AnyObject).enumerateObjects({(object : AnyObject!, idx : NSInteger,pointer :UnsafeMutablePointer<ObjCBool>) 
(self.columnHeights[section]作为AnyObject)。枚举对象({(object:AnyObject!,idx:NSInteger,pointer:UnsafeMutablePointer)
错误

无法使用类型为“((AnyObject!、NSInteger、UnsafeMutablePointer)->()”的参数列表调用“enumerateObjects”

请注意。

在Swift 3中,大多数
AnyObject
类型已更改为
Any

(self.columnHeights[section] as AnyObject).enumerateObjects({(object : Any, idx : Int, pointer :UnsafeMutablePointer<ObjCBool>) 
(self.columnHeights[section]作为AnyObject)。枚举对象({(object:Any,idx:Int,pointer:UnsafeMutablePointer)
始终推荐使用原生SWIFT <代码>数组<代码>,而不是使用基础<代码> NSArray < /C> >利用特定类型信息。

(self.columnHeights[section] as AnyObject).enumerateObjects({(object : Any, idx : Int, pointer :UnsafeMutablePointer<ObjCBool>)