English 中文(简体)
如何从 Apple果仓库提取信息?
原标题:How to extract app information from the Apple store?

I m a newbie with Json, so I want to extract some app information from the app store, I found this question here :

How to get info from the Apple iTunes «App Store» and «Mac App Store»

它允许查阅载有所有参考资料的Json档案,但如果有人能向我表明如何获得价格,那将是空洞的。

感谢。

最佳回答

你们想要取得什么成果? 这是否是一种工具或某种其他工具? 在重新使用JSON时,每个要素都有“货币”和“价格”价值。 这些问题可以简单地提出。 例如,使用SOS 5NSJSONSerialization(说明这是一个例子),必须处理更多的错误,处理没有/太多的条目等:

// assuming you have the downloaded data

NSError *error = nil;
NSDictionary *jsonData = [NSJSONSerialization JSONObjectWithData:downloadedData options:nil error:&error];

if (error != nil)
{
    // error handling
}
else
{
    NSArray *results = [jsonData objectForKey:@"results"];

    // assuming you have 1 valid entry
    NSDictionary *result = [results objectAtIndex:0];
    NSNumber *price = [result objectForKey:@"price"];
    NSString *currency = [result objectForKey:@"currency"];

    NSLog(@"Price is %@ @%", price, currency);
}

获取数据的类似方式在其他JSON框架中是可笑的,只是使结果阵列升级,而其中的每一字典都具有价格和货币价值。

问题回答

暂无回答




相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签