title: PFQuery findObjectsInBackgroundWithBlock: in WatchKit app works in simulator, not on watch unless iOS app is in foreground
body: <p>I'm writing a WatchKit app which needs to make a query to our Parse server. Because this is a network call, I follow the following procedure:</p>
  
  <ol>
  <li>I make a call from WatchKit to the iOS app using <code>openParentApplication:reply:</code> </li>
  <li>Inside of <code>handleWatchKitExtensionRequest:userInfo:reply:</code>, I start a background task with a <code>UIBackgroundTaskIdentifier</code> to ensure the iOS app isn't terminated immediately</li>
  <li>I set up my <code>PFQuery</code> and call <code>findObjectsInBackgroundWithBlock:</code></li>
  <li>In the block I pass to the PFQuery, I reply the relevant information to the watch</li>
  </ol>
  
  <p>I wrote this app maybe a month ago before the Apple Watch was out, and it ran just fine in the Watch simulator. Yesterday I received my Apple Watch and I was able to get the app running on the watch, but it doesn't quite work - I managed to figure out that when the iOS app is actively running in the foreground on the iPhone, then everything is great; but if the app is not active (e.g. backgrounded or terminated), then <code>findObjectsInBackgroundWithBlock:</code> never actually calls the block, and execution seems to just stop.</p>
  
  <p>Does anyone have any ideas of what might be going on? My initial thought was that the iOS app is getting suspended/killed before it can complete the query, but I was pretty sure the background task would prevent that.</p>
  
  <p>PS. If anyone stumbles upon this question because they were looking for how to get a WatchKit app running on an actual watch, I found <a href="http://blog.jaredsinclair.com/post/117350678170/jareds-code-signing-tips-apple-watch-edition" rel="nofollow">this post</a> extremely helpful in getting it working.</p>