开发者

NSArray Help for breaking information

Hi i am getting one response from the server "{\"bindings\":[{\"Latitude\":\"25.451808633333332\",\"Longitude\":\"81.83372523333333\"}]}" , it is in array, i need to break the latitu开发者_开发知识库de and longitude part or values and initialize the value into another string.


NSString *latitudeString = [[[jsonDict objectForKey:@"bindings"]objectAtIndex:0]objectForKey:@"Latitude"];
NSString *longitudeString = [[[jsonDict objectForKey:@"bindings"]objectAtIndex:0]objectForKey:@"Longitude"];

In more nice way:

NSDictionary *gealocationDict = [[jsonDict objectForKey:@"bindings"]objectAtIndex:0];
NSString *latitudeString  = [gealocationDict objectForKey:@"Latitude"];
NSString *longitudeString = [gealocationDict bjectForKey:@"Longitude"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜