这是我的测试查询
PFQuery *lookingForSomething = [PFQuery queryWithClassName:@"AprilMessage"];
[lookingForSomething whereKey:@"user" equalTo:[PFUser currentUser]];
[lookingForSomething findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
// nothing here
for (PFObject *objectFound in objects) {
NSLog(@" this is my objectFound", objectFound);
到目前为止一切顺利,我的NSLog(objectFound)的结果是:
{
message = hello world ! ;
reciever = "<PFUser:WNOmhmrO3L>";
user = "<PFUser:WNOmhmrO3L>";
我要做的是获取消息字符串“hello world!”并在屏幕上显示, 在这里我做了什么,但由于某种原因它不起作用
// same code from before just adding the last lines down there
PFQuery *lookingForSomething = [PFQuery queryWithClassName:@"AprilMessage"];
[lookingForSomething whereKey:@"user" equalTo:[PFUser currentUser]];
[lookingForSomething findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
// nothing here
for (PFObject *objectFound in objects) {
NSLog(@" this is my objectFound", objectFound);
// adding this new line
objectFound[@"message"] = _textChat.text; <-- textChat is a UITextView !!!
任何想法我哪里出错了?
答案 0 :(得分:0)
你的最后一行是倒退。它应该是,
_textChat.text = objectFound[@"message"];
这应该可以假设_textChat和objectFound [@“message”]都不是nil。