Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The code you have posted does not appear to be incorrect. I've made a best guess at some details you've left out and I get a successful result from a <a href="https://gist.github.com/1258465" rel="nofollow">test program</a> containing your code with enough boilerplate to show that it encodes/decodes correctly.</p> <p>(You can compile it from the command line using: <code>gcc -framework foundation test.m -o test</code> and run with: <code>./test</code>.)</p> <p>With regard to your question, <em>how can I debug this</em>, I would suggest an approach as follows:</p> <ul> <li>(Temporarily) modify your code to be as <strong>simple as possible</strong>. For example, you could change the <code>parameters</code> property to a plain <code>NSString</code> and verify that works correctly first.</li> <li>Slowly add in complexity, introducing <strong>one new property at a time</strong>, until the error starts occurring again. Eventually you will narrow down where the troublesome data is coming from.</li> </ul> <p>Alas, if this is occurring due to some mis-managed memory elsewhere in your app, debugging this code itself may not get you anywhere. Try (manually) verifying that memory is managed correctly for each piece of data you are receiving for encoding.</p> <p>If you are already using <a href="http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/coredata/cdprogrammingguide.html" rel="nofollow">Core Data</a> you could consider persisting just the <em>object ID</em> in the user defaults and restore your object graph based on that. (See: <a href="http://samsoff.es/posts/archiving-nsmanagedobject-with-nscoding" rel="nofollow">Archiving NSManagedObject with NSCoding</a>).</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