how to create json in objective-c

后端 未结 6 1483
眼角桃花
眼角桃花 2020-12-31 04:19
NSData* jsonDataToSendTheServer;

NSDictionary *setUser = [NSDictionary
            dictionaryWithObjectsAndKeys:[@\"u\" stringByAppendingString:my.id],@\"id\",
             


        
6条回答
  •  误落风尘
    2020-12-31 05:00

    Try this

    NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://api.iospond.com/api/index.php/GetData"]];
        NSError *error=nil;
        id response=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
        NSLog(@"Your JSON Object: %@ Or Error is: %@", response, error);
    

提交回复
热议问题