title: Using Parse to replace Core Data
body: <p>I just found out about <a href="http://blog.parse.com/learn/parse-local-datastore-for-ios/" rel="nofollow">Parse's Local Data Store</a> and it looks like a SQL database that handles online/offline syncing.</p>
  
  <p>I'm writing an application for a client who wants something similar to the contacts app. Contacts can be added/edited offline, or added on a different device, and they all need to sync properly and not create duplicate entities. </p>
  
  <p>Is using Parse Local Data Store a viable option?</p>
  
  <p>I do this in the App Delegate did finish launching with options method:</p>
  
  <pre><code>query.findObjectsInBackgroundWithBlock {
      (objects: [AnyObject]?, error: NSError?) -&gt; Void in
      if error == nil {
          if let objects = objects as? [PFObject] {
              PFObject.pinAllInBackground(objects, block: nil)
          }
      } else {
          println("Error: \(error!) \(error!.userInfo!)")
      }
  }
  </code></pre>
  
  <p>Then in my initial view controller I do this:</p>
  
  <pre><code>query.findObjectsInBackgroundWithBlock {
      (objects: [AnyObject]?, error: NSError?) -&gt; Void in
      if error == nil {
          if let objects = objects as? [PFObject] {
              self.athleteArray = objects
              self.tableView.reloadData()
          }
      } else {
          println("Error: \(error!) \(error!.userInfo!)")
      }
  }
  </code></pre>
  
  <p>However, I assume because the App Delegate query runs in the background, the data store hasn't received objects when the view controller runs because the tableview shows up empty. </p>
  
  <p>When I launch the app again later, the objects are there because the data store has been populated.</p>
  
  <p>How can I manage syncing objects (in real-time, no second app launching) using Parse's Local Data Store? Am I doing something incorrectly?</p>