0

I'm trying to see the contents of an NSData variable data 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.

Community
  • 1
  • 1
Marcus Leon
  • 53,069
  • 115
  • 287
  • 420

1 Answers1

7

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)
Gustanas
  • 406
  • 3
  • 13