Question

How would you use Obj-c to search the Apple App store to do the following...

  1. Return the details of the top 100 in the games overall category or a specific games category
  2. Return the details of a specific games in the games category

Anyone?

Était-ce utile?

La solution

Well, as far as I know you have two methods to search the App Store:

  1. Search API;
  2. RSS feed generator.

There are many differences between those but the most relevant for your example is that with the Search API you cannot sort the results as they come sorted by relevance and it requires always a search term. The RSS feed generator already has Top Free, Top Paid and Top Grossing categories for you.

Given this I'm going to start answering your question for the RSS feed generator.

  1. You use the RSS feed generator to generate feeds like this for the top 100 free games in the US store: https://itunes.apple.com/us/rss/topfreeapplications/limit=100/genre=6014/xml;
    • Take a loot at this link to get games sub genres;
  2. You use NSXMLParser library to parse the RSS which already includes the app details.
    • You may use the initWithContentsOfUrl: method of NSXMLParser;
    • A quick how-to for this part can be found here.

You can also use StoreKit to get the details of the apps by their ID or show a modal view controller with a specific app but that will require an extra network request.


For the sake of completeness I'll also cover how you can use the Search API.

  1. Use the Search API to create a URL that describes your search:
  2. Process the results using NSJSONSerialization library. That already includes the app details.

In the end, as @Numan said, this two methods accomplish different things. You said you wanted to have the top 100 games from a specific category and also said you needed to search for a specific game.

You can use my descriptions to create one class that interacts with the App Store in these two ways and return an object defined by you that describes an app (or an array of objects).

Autres conseils

You can access this info by RSS, look here http://www.apple.com/rss/

Also you can generate RSS feed http://itunes.apple.com/rss/generator/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top