macosparse-platformxcode6.3parse-osx-sdk

Parse OS X SDK doesn't work (and doesn't give any error)


I've created a new OS X app (I'm on latest Yosemite), grabbed the latest Parse OS X SDK, integrated it, and tried a query (on my already working Parse app that works just fine with iOS and Android) and it never completes. After initializing Parse as usual in app delegate, I call this:

PFQuery *usersQuery = [PFQuery queryWithClassName:@"_User"];
[usersQuery countObjectsInBackgroundWithBlock:^(int count, NSError *err){
        //we never get here!!
    }
}];

The completion handler is never called. No error, no warnings, nothing! I've tried a synchronous version of it:

int x = [usersQuery countObjects];

It immediately returns -1 without even sending a network request. I've tried to see what error it gives:

NSError *err;
int x = [usersQuery countObjects:&err];

And err still stays nil after the count method [immediately] returns. I've tried wrapping the call inside dispatch_async and dispatch_after blocks just in case I'm missing something about where to call it from, but no avail.

What can be the problem?


Solution

  • It was something to do with configuration. I was using CocoaPods to get the Parse framework. I've removed the pod, and downloaded the framework files manually from Parse's website, and added them to my project by old school drag and drop, and it worked. I don't know what was causing the problem, though.