title: How to grab object id from UITableView and delete object based on object id?
body: <p>Now I got problem with this one, I don't know how to grab object id from UITableView after user select from it and pass it into another view controller, I want to delete the object based on object id that I already fetch from previous one. All the data come from <code>user</code> entity.</p>
  
  <p>UITableView</p>
  
  <pre><code>var myList: Array &lt;AnyObject&gt; = []
  
  func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
  
          let appDel: AppDelegate = (UIApplication.sharedApplication().delegate as AppDelegate)
          let context: NSManagedObjectContext = appDel.managedObjectContext!
  
          /* grab object id here from core data object and pass to NSUserDefault*/
          NSUserDefaults.standardUserDefaults().setObject(objectId, forKey: "userId")
  
          let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
  
          let deleteViewController = storyBoard.instantiateViewControllerWithIdentifier("accessView") as DeleteViewController
          self.presentViewController(deleteViewController, animated:true, completion:nil)
  
      }
  </code></pre>
  
  <p>DeleteViewController</p>
  
  <pre><code> let objectId = NSUserDefaults.standardUserDefaults().stringForKey("userId")
  /* Grab object id from NSUserDefault and delete object here*/
  </code></pre>