Nsdictionary中的Nsarray在swift中显示错误的值

时间:2017-05-05 10:15:04

标签: arrays swift dictionary

代码

let emailArray : [String?] = [email]


        let dictionary: [String: AnyObject] = [
            "subject": "subject" as AnyObject,
            "emails" :emailArray as AnyObject ,
            "message" : comment as AnyObject

        ]
        print(dictionary)

打印时我正在使用字典

["emails": <Swift._SwiftDeferredNSArray 0x608000628320>(
sasa@pylit.in
)
, "message": EWQF , "inclideReview": 0, "subject": subject]

如何从此删除<Swift._SwiftDeferredNSArray 0x608000628320>?我尝试了很多但没有运气!

1 个答案:

答案 0 :(得分:1)

将字典更改为[String: Any]并从每行中删除as AnyObject