How to add NSIndexPath to NSUserDefaults in swift
<p>I am trying to save <code>NSIndexPath</code> at <code>NSUserDefaults</code>, but got the following exception:- </p>

<blockquote>
  <p>Attempt to set a non-property-list object  {length = 2, path = 0 - 12} as an
  NSUserDefaults/CFPreferences value for key LastSelectedIndeX</p>
</blockquote>

<p>My code:-</p>

<pre><code>let selectedIndexPath = tableView.indexPathForSelectedRow
   NSUserDefaults.standardUserDefaults().setObject(selectedIndexPath, forKey: "lastSelectedIndex")
   NSUserDefaults.standardUserDefaults().synchronize()
</code></pre>

<p>So how can I save <code>NSIndexPath</code> so that I can use it later on at another view controller.</p>