The problem is that the pointer nrlsl9lkvt
on the first picture points NOT to the record with the testing123 text, but to the record below. The phoneNumber record with the testing123 text has objectId o5igPWMaat, not nrlsl9lkvt.
You can get the text by quering for the NewChat object and use
[query includeKey:@"receiver"];
to ensure the phoneNumber object is downloaded as well. Just add a text to the right object in phoneNumber, and you're all set
UPDATE
Since you edited your question:
Your query should return the object you want (with objectId T9kPD...). Did you try the log statement I suggested? NSLog(@"objects: %d", [objects count]);
To get the text you want:
PFObject *object = [objects lastObject]; // Since your query should return only 1 object
NSLog(object[@"text"]); // The "text" property of the object returned
If you're only interested in one object (like above), or KNOW there will only be one object, you should probably use getFirstObjectInBackgroundWithBlock
: instead of findObjectsInBackground...
. This will return one object instead of an array, and remove the need to call [objects lastObject];