Marcus Leon Marcus Leon - 5 months ago 5x
Swift Question

Viewing NSData contents in Xcode (Swift)

I'm trying to see the contents of an NSData variable

in the Xcode debugger. This question asks the same thing but regards to an Objective C pointer to an NSData variable. How can you do this with a Swift NSData variable?

Note in this case the data is a String.


If you want to see the string representation of your NSData variable you can use the following code in the debugger

po NSString(data: yourData, encoding: NSUTF8StringEncoding)