0
我想收集所有值從「價格」到數組,並計數,但可悲的是,所有的時間我有0個項目在數組中。如果你對obj-c有所瞭解,請加以寬恕。從Json Api陣列中的元素
NSData *data = [apiHandler getResponseFromPublicServerUrl:@"https://bitcoinity.org/markets/get_depth_change?currency=USD&exchange=btce&dc_span=10m"];
NSError* error;
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:data
options:kNilOptions
error:&error];
NSArray *resultArray = [json objectForKey:@"price"];
NSLog (@"Number of elements in array = %lu", [resultArray count]);
'NSDictionary * json'應該是'NSArray * json' ... JSON返回數組... –