变量上的IOS变量

变量上的IOS变量,ios,Ios,我试图运行for循环,为解析中的每一行添加UILabels,当有多行时,它不会显示任何内容。这是可能的,如果不是,最好的方法是什么 这是我的密码: PFQuery *query = [PFQuery queryWithClassName:@"Account"]; [query whereKey:@"user" equalTo:[PFUser currentUser]]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSE

我试图运行for循环,为解析中的每一行添加UILabels,当有多行时,它不会显示任何内容。这是可能的,如果不是,最好的方法是什么

这是我的密码:

PFQuery *query = [PFQuery queryWithClassName:@"Account"];
[query whereKey:@"user" equalTo:[PFUser currentUser]];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    NSNumberFormatter *f; // and you should reuse formatter
    [f setNumberStyle:NSNumberFormatterDecimalStyle];
    int x = 0;
    for (PFObject *object in objects) {

        // Title Design
        CGRect labelocation(x) = CGRectMake(40, 105+(35*x), 100, 30);
        UILabel *myLabel(x) = [[UILabel alloc] initWithFrame:labelocation(x)];
        myLabel(x).text = object[@"name"];
        myLabel(x).layer.backgroundColor = [UIColor colorWithRed:52.0/255 green:170.0/255 blue:220.0/255 alpha:1].CGColor;
        myLabel(x).textColor = [UIColor colorWithRed:0/255 green:0/255 blue:0/255 alpha:1];
        [self.view addSubview:myLabel(x)];

        //Second Amount Design
        CGRect secondAmountSize(x) = CGRectMake(141, 105+(35*x), 150, 30);
        UILabel *secondAmount(x) = [[UILabel alloc] initWithFrame:secondAmountSize(x)];
        secondAmount(x).layer.backgroundColor = [UIColor colorWithRed:52.0/255 green:170.0/255 blue:220.0/255 alpha:1].CGColor;
        secondAmount(x).textColor = [UIColor colorWithRed:0/255 green:0/255 blue:0/255 alpha:1];
        secondAmount(x).textAlignment = NSTextAlignmentRight;
        secondAmount(x).text = object[@"startingBalance"];

        [self.view addSubview:secondAmount(x)];
        x++;
     }

}];

要在uitableview单元上添加标签,可以使用自动布局,而不是手动计算标签框