Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You aren't showing the code that actually obtains the data object, nor are you showing any code related to an NSString.</p> <p>Are you just assigning a string (<code>producedData</code>) to your <code>myData</code> variable? That won't create a data object; for one thing, it wouldn't know what encoding to use to encode the string's characters into bytes, and more importantly, copying a pointer from one variable to another (which is what <code>myData = producedData</code> does—the variables do not contain the objects themselves, only pointers to them) does not change anything about what the pointer points to. The object will remain a string, even though you told the compiler that <code>myData</code> would point to a data object. The compiler should be warning you about this; you should heed and fix those warnings.</p> <p><code>myData</code> definitely is not a data object; if it were, its description of itself would be a hex dump. It is either a string or a dictionary.</p> <p>The output you showed matches the syntax that an NSDictionary uses to describe itself. On the other hand, the object could be a string containing such a description. (This latter case is what you're expecting.)</p> <p>If you have a dictionary: You're done! The object is already parsed.<br> If you have a string: Send it a <code>propertyList</code> message, which will parse the string as a property list and return whatever value is represented in it, which, in this case, will be a dictionary.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload