问题描述
let parameter : Dictionary<String,AnyObject> = ["action":"add-playlist-item","playlist_id":self.dictPlayList.objectForKey("ID")!,"kod_id":arrayOfID]
错误
[action:add-playlist-item,playlist_id:166,kod_id:< _TtCs21_SwiftDeferredNSArray 0x7c615620>(
21,
18
)
]
error["action": add-playlist-item, "playlist_id": 166, "kod_id": <_TtCs21_SwiftDeferredNSArray 0x7c615620>(21,18)]
_TtCs21_SwiftDeferredNSArray 0x7c615620这个错误是什么意思?
_TtCs21_SwiftDeferredNSArray 0x7c615620 what does this error mean??
推荐答案
检查您是否使用JSON参数编码,而不是URL编码。
Check that you are using JSON parameter encoding, not URL encoding.
您可能遇到了同样的问题。我看到< _TtCs21_SwiftDeferredNSArray 0x7c615620>
也出现在我的请求中。当我更改为JSON编码时,一切正常。我不认为这样的字典结构可以被正确的URL编码。我不知道你是如何实际提出请求的,或者我会发布代码。
You may be having the same problem I was having. I was seeing <_TtCs21_SwiftDeferredNSArray 0x7c615620>
appear in my requests too. When I changed to JSON encoding, everything worked. I don't think a dictionary structure like that can be properly URL encoded. I'm not sure how you're actually making the request or I would post code.
这篇关于词典中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!