dispay指针作为文本标签ios

时间:2015-12-30 17:52:23

标签: ios parse-platform

我搜索了解析文档但无法解决这个问题。我有一个用户类,然后是一个玩家类(称为Junkballer)。在玩家类中,我得分是一个数字。我正在尝试在文本标签中显示每个玩家的得分。

它只显示零。

-(void)viewWillAppear:(BOOL)animated {

    PFQuery *groundstrokeQuery = [PFQuery queryWithClassName:@"Junkballer"];
    [groundstrokeQuery whereKey:@"groundstrokes" equalTo:[PFUser currentUser]];
    //[groundstrokeQuery includeKey:@"groundstrokes"];
    [groundstrokeQuery countObjectsInBackgroundWithBlock:^(int count, NSError *error) {
        if (!error) {
            // The count request succeeded. Log the count
            NSLog(@"You have hit %d groundstrokes!", count);
            self.groundStrokes.text = [NSString stringWithFormat:@"%d",count];
        } else {
            // The request failed
        }
    }];






} 

0 个答案:

没有答案