Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 从Parse.com检索数据花费的时间太多_Ios_Objective C_Iphone_Xcode6 - Fatal编程技术网

Ios 从Parse.com检索数据花费的时间太多

Ios 从Parse.com检索数据花费的时间太多,ios,objective-c,iphone,xcode6,Ios,Objective C,Iphone,Xcode6,我在parse.com中创建了一个应用程序,并在一个类中添加了5行7列。现在,当我使用objectid从那里检索数据时,大约需要10秒才能获取所有数据。这是我的密码: for (int i=0; i<5; i++) { PFQuery *query = [PFQuery queryWithClassName:@"QUestion"]; [query getObjectInBackgroundWithId:[arrId objectAtIndex:i] block:^(PF

我在parse.com中创建了一个应用程序,并在一个类中添加了5行7列。现在,当我使用objectid从那里检索数据时,大约需要10秒才能获取所有数据。这是我的密码:

for (int i=0; i<5; i++)
{
    PFQuery *query = [PFQuery queryWithClassName:@"QUestion"];

    [query getObjectInBackgroundWithId:[arrId objectAtIndex:i] block:^(PFObject *Q_1, NSError *error)
     {

         [arrQuestion addObject:Q_1[@"Ques"]];
         [arrAns1 addObject:Q_1[@"Ans1"]];
         [arrAns2 addObject:Q_1[@"Ans1"]];
         [arrAns3 addObject:Q_1[@"Ans1"]];
         [arrAns4 addObject:Q_1[@"Ans1"]];
          //.........

         NSLog(@"%@",arrQuestion);

     }];


}

对于(inti=0;i我将使用带有条件objectId
的find方法,其中
=id数组


通过这种方式,您可以在单个网络请求中获取对象数组。

为什么要在循环中执行此操作?我有arrId,它包含所有5个ObjectDSIR,您能解释一下吗?