将JSON值传递给其他类时出现问题

时间:2014-06-02 09:52:25

标签: getjson

我需要将JSON值传递给其他类。但是词典显示" NULL"值。我在我的代码中使用 NSURL连接

-(void)connectionDidFinishLoading:(NSURLConnection *)connection  {

NSDictionary *allDataDictionary=[NSJSONSerialization JSONObjectWithData:webResponseData options:0 error:nil];

 NSLog(@"allDataDictionary = %@",allDataDictionary);

SecondViewController *a=[[SecondViewController alloc]init];

a.staticData=[allDataDictionary objectForKey:@"Customerlist"];
}

But the Dictionary shows "NULL" value.

Output Response:

{   "ReturnCode": "0",
    "Salesmanid": "",
    "Customerlist": [
        {
            "Customerid": "GENERAL CUSTOMER USD",
            "Customername": "Name of GENERAL CUSTOMER USD",
            "Contact": "123456",
            "Street1": "north street",
            "Street2": "south street",
            "City": "america",
            "Province": "",
            "Postal": "2343",
            "Country": "ZA",
            "Phone": "324567",
            "Mobile": "2323444555",
            "Email": "as@yahoo.co.in",
            "VetReg": "",
            "RegNo": "002",
            "LastUpdated": "2009-03-03T18:10:00"
        },

我需要将这些值解析为其他类。任何人都可以帮助我吗?

0 个答案:

没有答案