Skip to content

Instantly share code, notes, and snippets.

@jkereako
Last active April 17, 2024 22:07
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jkereako/606cda72f3f8aa5c6c8eb5ec8ce227a1 to your computer and use it in GitHub Desktop.
Save jkereako/606cda72f3f8aa5c6c8eb5ec8ce227a1 to your computer and use it in GitHub Desktop.
LLDB commands to print a Data object as a String. It only works if the underlying data is actually a String.
// See: http://stackoverflow.com/questions/11531353/viewing-nsdata-contents-in-xcode#25097265
po String(data: data, encoding: .utf8)
// Objective-C equivalent.
// See: http://stackoverflow.com/questions/11531353/viewing-nsdata-contents-in-xcode#19626815
// p (char *)[buffer bytes]
@dstuecken
Copy link

+1 - thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment