Starting my first iOS project and wanted to advice on how to structure the application. The app pulls a XML feed, parses it out and displays a list representing the items in the XML feed. When clicking on a item in the list the app will pull a new XML feed using one of the attributes from the previously pulled XML feed. This happens several layers of pull, parse, display and on user selection do the same thing over again. Now most of the XML element structure is something like this:
(这些只是证明正在发生的事情的简单例子)
returns (Display info on new view):
<items>
<item id="123" name="item 1" />
<item id="124" name="item 2" />
<item id="125" name="item 3" />
</itmes>
- http://site.com/get/description/123 (Example user has selected item 1, make call to get description)
返回:
<itemDescription>
<description itemId="123" name="desc 1" description="blah 1" />
</itemDescription>
了解:
- Should I have a connection class/object or a new connection in each view?
- Should I have a parser class/object or parse the XML feed in each view?
- I m also looking to store some of the data returned so I don t need to call the XML feed again if the user navigates back to the main items list, but I would need to parse the itemsDescription XML feed every time.
我审视了几门教法的教导,我看到了如何做到这一点,希望更多地关注设计和可使用性,而不是在每一种新观点中重复该法典。 或者,我如何做这项工作。