在xcode中制作聊天应用

时间:2012-12-05 15:22:25

标签: ios xcode

我正在尝试使用http://www.parse.com在xcode中制作我的第一个应用。我正在复制this guys指令,当我开始使用此代码时,我收到并出错

PFObject *testObject = [PFObject objectWithClassName:@"TestObject"];
[testObject setObject:@"bar" forKey:@"foo"];
[testObject save];
在FirstViewController.m文件中

 #import "DMFirstViewController.h"
@interface DMFirstViewController ()
@end
@implementation DMFirstViewController
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    PFObject *testObject = [PFObject objectWithClassName:@"TestObject"];
    [testObject setObject:@"bar" forKey:@"foo"];
    [testObject save];  
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
@end

有人可以帮助我,我会在发布后发布错误。让我知道你需要我发布的其他代码,谢谢。

Here is a pictures of my FirstViewController.m file with the error. closer picture

1 个答案:

答案 0 :(得分:2)

你错过了这一行

 #import <Parse/Parse.h> 

每次使用像PFObject一样的“PF”开头的东西时,它都是解析框架使用的对象,因此你需要导入框架。