how to convert [Any] to NSArray?

后端 未结 1 2034
孤城傲影
孤城傲影 2021-01-26 06:13

\"warning

how to convert [Any] Array to NSArray, because I want to use

相关标签:
1条回答
  • 2021-01-26 06:37

    Why are you converting [Any] to NSArray when you can use reversed() with your [Any]? In Swift it's better to use a native Array instead of NSArray.

    for item in keysStoreBySize.reversed() {
    
    }
    

    If you still want to use NSArray then you can use the NSArray initializer init(array:).

    let array = NSArray(array: keysStoreBySize) //Will convert [Any] to NSArray
    
    0 讨论(0)
提交回复
热议问题