So I have a parse app in the appstore already. I'm about to submit an update for the app using the latest Parse SDK 1.7.4 and I noticed the manual parse login IS NOT WORKING!
I hope this is due to my code and not a parse issue because that's a major f**k up if you ask me...
Anyway, here is the code, any help is appreciated.
[PFUser logInWithUsernameInBackground:username password:password block:^(PFUser *user, NSError *error) {
if (!error) {
//do stuff with user
} else {
//error handling here
}
I of course did some search on the internet to find an answer and most people are saying not to use the background functions because things need to run on the main thread. And I tried using the dispatch async and forced it to run on the main thread but still no callback from the login.
Here is the error msg I'm getting:
-[BFTask isFaulted]: unrecognized selector sent to instance
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BFTask isFaulted]: unrecognized selector sent to instance
When I run the below code:
NSError *error;
PFUser *user = (PFUser *)[PFUser logInWithUsername:username password:password error:&error];
if (error) {
//do error handling here
} else {
//do stuff with user object here and go to logged in screen.
}
Also, I wanna note, I have this:
NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException";
in my AppDelegate just to be able to compile and run the app ever since I upgraded to Parse 1.7.4 SDK.
These are the errors I get if I take out this line from the AppDelegate:
"_BFTaskMultipleExceptionsException", referenced from:
___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke226 in Parse(PFObject.o)
___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke319 in Parse(PFObject.o)
Here is a question that's similar to this in Parse blogs that's not really solved:
https://www.parse.com/questions/ios-sdk-loginwithusernameinbackgroundpasswordblock-does-not-execute-block-on-error-case
Thanks in advance for help.