Search code examples
iosparse-platformpfuser

PFUser Not returning objectID value on iOS


I am trying to get the objectId key from a PFUser using Parse.com, but it keeps returning null.

PFUser *me = [PFUser currentUser];
NSString *theObject = me[@"objectId"];
NSLog(@"Return %@", theObject);

Every time I run this, it comes back as "Return null". I can put username in where I type objectId, and will get a result, but not for objectId.


Solution

  • Try:

    NSString *theObject = [me objectId];
    

    From:

    Getting objectId from parse.com