If you're trying to get the image that is inside an object through it's pointer, you need to call fetch
first.
So, if I understand you question correctly, you should try:
PFObject *object...
[object fetchIfNeededInBackgroundWithBlock:^(PFObject *object, NSError *error) {
if (!error) {
// Now get the file
PFFile * connectImageFile = [object objectForKey:@"prayerImage"];
// continue your code
}
}];
UPDATE:
This is the code that works for me. Unfortunately, I couldn't do it with only one request, as you wanted. In order to do that, you must already have fetched for the object before.
// This is the PFObject
PFObject *object = [PFObject objectWithoutDataWithClassName:@"SomeClass" objectId:@"id"];
// I needed to fetch the first object
[object fetchIfNeededInBackgroundWithBlock:^(PFObject *object, NSError *error) {
// Here, I get the second object, inside pointer column
PFObject *object2 = object[@"pointer"];
// Fetch again to get data
[object2 fetchIfNeededInBackgroundWithBlock:^(PFObject *object, NSError *error) {
// get PFFile in image column
PFFile * file = [object2 objectForKey:@"image"];
NSLog(@"url %@", file.url);
// Now continue code to assign image.
}];
}];
If you query for the object in question, you could include key that has the pointer, that way you would use only one request.