Im attempting to convert a NSDictionary to JSON using the NSJSONSerialization.dataWithJSONObeject function
Code :
do{
let jsonData = try NSJSONSerialization.dataWithJSONObject(SerializationHelper.toDictionary(user), options: NSJSONWritingOptions.PrettyPrinted )
print(jsonData)
} catch {
print(error)
}
all is well except the jsonData is being printed in hexadecimal?
<7b0a2020 22706173 73776f72 6422203a 20227465 7374222c 0a202022 75736572 6e616d65 22203a20 22546573 74220a7d>
When this hexadecimal string is converted to binary it does infact equal the JSON object but obviously I need the JSON object straight away.
Any ideas why this is the case?