Getting objectId from parse.com

ios, iphone, nsarray, nsdictionary, parse-platform

Solution

In my `didSelectRowAtIndexPath:` method, I did the following:

PFObject *myObject = [parseArray objectAtIndex:indexPath.row];

NSString *objectId = [myObject objectId];

Problem

So I am building an app that uses parse as a backend. I've written my own before but I figured I'll just save some time and use parse. I'm populating a table view with data from parse and that's fine. I want to grab the objectId from an dictionary built from an array from parse. The output of my array is as follows: ``` <news_events:pdbIEvOteH:(null)> {\n eventDescription = \"This is a test description.\";\n eventMessage = \"This is a test message.\";\n eventTitle = \"Free Wi-Fi Now Available!\";\n} ``` The object ID is `pdbIEvOteH` in the example above. I at first tried getting the id by using: `NSString * objectId = [myDictionary objectForKey:@"objectId"];` But that returned null. I know it is not a problem with my dictionary because I can get other information. The problem is it looks like there is no key for `objectId` in the array above. As you can see it follows `news_events`. I know you can get it with the `PFObject` but I'm not sure if I can populate a table with a `PFObject`. So bottom line is how do I get the `objectId`.

Original source