2
     let parameter : Dictionary<String,AnyObject> =  ["action":"add-playlist-item","playlist_id":self.dictPlayList.objectForKey("ID")!,"kod_id":arrayOfID]

error ["action": add-playlist-item, "playlist_id": 166, "kod_id": <_TtCs21_SwiftDeferredNSArray 0x7c615620>( 21, 18 ) ]

_TtCs21_SwiftDeferredNSArray 0x7c615620 what does this error mean??

Prashant Ghimire
  • 518
  • 4
  • 20

2 Answers2

0

Array is a value type and it's not an object, but a struct. So it doesn't conform to AnyObject protocol. Use Any instead of AnyObject. See more details here and here.

Community
  • 1
  • 1
Access Denied
  • 8,723
  • 4
  • 42
  • 72
0

Check that you are using JSON parameter encoding, not URL encoding.

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.

Typewriter
  • 1,216
  • 1
  • 11
  • 18