Search code examples
objective-cmacosparse-platformpfuser

Unable to login PFUser or create PFObjects in OSX


Edit 1

Actually there's something more serious going on here as i am also not able to create and test objects.

So i have imported #import

Then i am calling the following from applicationDidFinishLaunching:

- (void)initParse {

[Parse setApplicationId:@"-----"
              clientKey:@"-----"];


PFObject *testObject = [PFObject objectWithClassName:@"TestObject2"];
testObject[@"foo"] = @"barking";
[testObject saveInBackground];

}

With the correct application and client keys, but i am getting the following error logged in the console:

[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]

No idea why this is not working??

Thanks

Gareth

Ok, bit stumped on this one.

I have an OS X application, and i am trying to login a user using the following method in my viewController class, as follows:

- (IBAction)loginButton:(id)sender {

[PFUser logInWithUsernameInBackground:@"myname" password:@"mypass"
                                block:^(PFUser *user, NSError *error) {
                                    if (user) {
                                        // Do stuff after successful login.
                                        NSLog(@"User Logged In");

                                    } else {
                                        // The login failed. Check error to see why.
                                        NSLog(@"User Login failed");
                                    }
                                }];


}

I have manually entered the username and password strings whilst troubleshooting.

Irrelevant of whether i set them to valid credentials or not the block never get's executed, if i set breakpoints none of them ever get hit, and none of the messages get logged.

Am i missing something? I don't see why this is not working. I have an iOS app setup with the same app id and key and that logs in using the same credentials fine, but this one will not.

Anyone got any ideas what's going on here?

Thanks

Gareth


Solution

  • Ok so for anyone else who hits this, it's because i wasn't including the Bolts.framework in my application.

    Not mentioned anywhere in the Parse docs that this framework is needed. Dropped it in and like magic it started working.

    Very unhelpful that there was nothing logged when it wasn't loaded from the Parse framework . . .

    That's 8 hours of my life i'm never getting back!

    Cheers

    Gareth