2012-12-09 82 views
1

我想用JSON來解析我從ASIHttpRequest得到的但我找到鏈接器錯誤使用Json解析字符串時的鏈接器錯誤

Undefined symbols for architecture i386: 
"_OBJC_CLASS_$_SBJsonParser", referenced from: 
objc-class-ref in AppDelegate.o 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation 

下面是我using.For我已經在項目中加入的Json類更詳細的代碼。

(void)requestFinished:(ASIHTTPRequest *)request{ 
    // Use when fetching text data 
    NSString *responseString = [request responseString]; 

    SBJsonParser *parser=[[SBJsonParser alloc]init ]; 
    NSDictionary *obj=[parser objectWithString:responseString error:NULL]; 
    NSArray *list=[obj objectForKey:@"lessons"]; 
    // Use when fetching binary data 
    // NSData *responseData = [request responseData]; 
} 
+1

dasblinkenlight當然是正確的。 :)但這似乎是我喜歡它將是切換到NSJSONSerialization的好時機! [補丁ASI或更好的:離開它!] –

回答

0

從搜索中我發現我們必須在編譯源中包含.m Json文件。我們可以通過點擊項目 - >目標 - >構建階段 - >編譯源 - >添加所有json .m文件來實現。