Swift String 报错。

2018-04-02  本文已影响38人  _10_01_

Argument type 'String' does not conform to expected type 'NSCopying'
Argument type 'String' does not conform to expected type 'NSSecureCoding'

String 是一个 Struct,而 class NSString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding 集成了 NSCopying 和 NSSecureCoding;

所以报错时将 String 替换成 NSString 即可。

上一篇下一篇

猜你喜欢

热点阅读