dispatch_promise(^{ return md5(email); }).then(^(NSString *md5){ return [NSURLConnection GET:@"http://gravatar.com/%@", md5]; }).then(^(UIImage *gravatarImage){ self.imageView.image = gravatarImage; }); PFQuery *query = [PFQuery queryWithClassName:@"Student"]; [query orderByDescending:@"gpa"]; [[[[[self findAsync:query] continueWithSuccessBlock:^id(BFTask *task) { NSArray *students = task.result;