NSMutableArray addObject isn工作

时间:2016-10-05 02:50:15

标签: ios objective-c nsmutablearray

我正在尝试创建一个NSMutableArray,它将成为UIPickerView的dataSource,但没有任何东西被添加到数组中,控制台只显示(。我做错了什么?

NSMutableArray *arr = [[NSMutableArray alloc] init];

    PFQuery *rejectedNumber = [PFQuery queryWithClassName:@"Group"];
    [rejectedNumber findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {

        if (!objects) {
            // Did not find any UserStats for the current user

            NSLog(@"NotFound");
        } else {

           for (int i=0;i<[objects count];i++)
            {
                PFObject * obj = [objects objectAtIndex:i];
                self.theObject = obj;

                NSString *string = obj[@"GroupName"];
                [arr addObject:string];
                NSLog(@"GOGOGO%@", arr);

            }

0 个答案:

没有答案