So I am able to store data into my parse class, but I can't read out the values.
this is where i declare a relationship between my Userinfo class and my User class :
PFObject *userObject = [PFObject objectWithClassName:@"UserInfo"];
[userObject setObject:[PFUser currentUser] forKey:@"Username"];
i then set values in the UserInfo class and it stores correctly, but when i go to read the values out of the database i get no objects were read out.
PFQuery *load =[PFQuery queryWithClassName:@"UserInfo"];
[load whereKey:@"Username" equalTo:[PFUser currentUser]];
[load findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
if(!error)
{
if (!error) {
infoArray = [[NSArray alloc] initWithArray:objects];
NSLog(@"Successfully retrieved %d obj.", infoArray.count); //this comes back as zero
NSLog (@"idummy %@", infoArray);
}
}
}];
I feel like I'm close but missing one step, I also checked I do not have any code executing in my
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
besides my parse key and client id.
UPDATE:
So i have figured out the above issue:
NSString *ObjID=curr.objectId;
PFQuery *load =[PFQuery queryWithClassName:@"UserInfo"];
[load whereKey:@"objectId" equalTo:ObjID];
it works when i @"adf234" for the equalTo, but is there for me to search based on the NSString ObjID value? Because it doesn't work when i put ObjID like i have above.