NSDictionary to NSData and NSData to NSDictionary in Swift

前端 未结 6 1446
故里飘歌
故里飘歌 2020-12-12 23:54

I am not sure if I am using the dictionary or the data object or both incorrectly. I m trying to get used to the switch to swift but I\'m having a little trouble.

         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-13 00:14

    For Swift 3:

    let data = try PropertyListSerialization.data(fromPropertyList: authResponse, format: PropertyListSerialization.PropertyListFormat.binary, options: 0)
    

提交回复
热议问题