Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.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_Iphone_Xcode - Fatal编程技术网

Ios 从parse.com检索数据并显示它们

Ios 从parse.com检索数据并显示它们,ios,iphone,xcode,Ios,Iphone,Xcode,我正在尝试从parse.com检索我已经发送的数据 我正在使用以下代码发送数据: -(IBAction)msgSend:(id)sender { PFObject *appMsg = [PFObject objectWithClassName:@"appMsg"]; appMsg[@"besked"] = msg.text; [appMsg saveInBackground]; msg.text = @""; } 为了获取数据,我尝试以下方法: PFQuery

我正在尝试从parse.com检索我已经发送的数据

我正在使用以下代码发送数据:

-(IBAction)msgSend:(id)sender {
    PFObject *appMsg = [PFObject objectWithClassName:@"appMsg"];
    appMsg[@"besked"] = msg.text;
    [appMsg saveInBackground];
    msg.text = @"";
}
为了获取数据,我尝试以下方法:

PFQuery *query = [PFQuery queryWithClassName:@"appMsg"];
    [query getObjectInBackgroundWithId:@"*******" block:^(PFObject *appMsg, NSError *error) {
        NSString *besked = appMsg[@"besked"];
        msgRecieved.text = besked;
    }];
最后,我尝试将数据显示到文本视图中


我没有真正加载任何数据?

由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因是:“此查询具有未完成的网络连接。登录parse.com,您必须等待它完成。检查您的类“appMsg”是否有任何行?如果是,则检索列值,如我给出的示例,使用类名和列名,而不是Mine。当您在XCode外部重命名某些文件时,可能会发生此错误。要解决这个问题,您只需从项目中删除文件(右键单击-删除并“删除引用”),然后重新导入项目中的文件,一切都会正常!谢谢你,伙计。这起作用了。然后如何显示阵列?我得到100多个阵列,我想显示最近的10个。我试过:NSString*msg=object[@“msg”];msgRecieved0/1/2/3.text=besked[0/1/2/3];我在这里得到了工作代码,但现在我只需要显示值。我在NSLog中得到了正确的值,我已经将限制设置为10次查询。如何“创建”回显对象C中的数据?如果我用php编写,我会为每个字符串回显一个div。但我还不知道如何在Xcode中实现这一点。我应该设置UIView/UITextView/UITableView还是应该使用某种“创建”函数来创建带有字符串的新标签?我知道我在目标C是neewbie,但我真的很高兴你的帮助!:)
 PFQuery *query = [PFQuery queryWithClassName:@"tempClass"];
    [query orderByDescending:@"createdAt"];
    query.limit =10;
    [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
      if (!error) {
        // Retrive values like below,object id is retrieved by objects.objectId
         NSLog(@"Object values %@",[objects valueForKey:@"columnName"]);
      } else {
        // Log details of the failure
        NSLog(@"Error: %@ %@", error, [error userInfo]);
      }
    }];