I tried to figure out what I was doing wrong all day, but I absolutely do not know why the application always crashes.
The situation is as follows:
I created a simple project with all the necessary libraries and frameworks. I created several Parse users with the following instance method:
[self signUpUserWithName:@"nico" withPassword:@"123"];
[self signUpUserWithName:@"gabriel" withPassword:@"123"];
[self signUpUserWithName:@"bruno" withPassword:@"123"];
Here you can see the implementation of the method:
-(void)signUpUserWithName:(NSString *)username withPassword:(NSString *)password{
PFUser* user = [PFUser user];
user.password = password;
user.username = username;
[user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if(!error){
NSLog(@"User created.");
}
else{
NSLog(@"User couldn't be created.");
}
}];
}
It works as expected, users are created, and everything is in order. Now I register the user and create a PFUser object for the current user using the following code:
[PFUser logInWithUsername:@"user1" password:@"123"];
PFUser* currentUser = [PFUser currentUser];
if ([currentUser isAuthenticated]){
NSLog(@"Authenticated");
}
else{
NSLog(@"Not Authenticated");
}
, . , currentUser, . , , " " ( ).
PFQuery* friendQuery = [PFUser query];
[friendQuery whereKey:@"username" equalTo:@"user2"];
[friendQuery getFirstObjectInBackgroundWithBlock:^(PFObject *object, NSError *error) {
if(!error){
NSLog(@"%@",object);
currentUser[@"myfriends"] = object;
[currentUser save];
}
else{
NSLog(@"Failed getting User Object.");
}
}];
, . Parse, , user2 " ".
, . - , PFUser, PFObject , "" PFUser, . , . PFUser, :
2015-01-19 13:44:09.135 localizr[2320:281655] -[__NSCFBoolean _loadSensitiveUserDataFromKeychainItemWithName:]: unrecognized selector sent to instance 0x19967eb60
2015-01-19 13:44:09.136 localizr[2320:281655] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean _loadSensitiveUserDataFromKeychainItemWithName:]: unrecognized selector sent to instance 0x19967eb60'
*** First throw call stack:
(0x188301e48 0x1989fc0e4 0x188308f14 0x188305cc4 0x18820ac1c 0x1000758a4 0x10006f97c 0x10007f25c 0x10007ecbc 0x10007ead4 0x10000d1f8 0x18cb223d0 0x18cd39230 0x18cd3b9b0 0x18cd3a048 0x190565640 0x1882ba124 0x1882b922c 0x1882b742c 0x1881e51f4 0x18cb1b78c 0x18cb16784 0x10000d4c4 0x19906aa08)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
?
.
EDIT:
:
* thread
frame
frame
frame
frame
frame
frame
frame
frame
frame
frame
frame
frame
* frame
frame