开发者

Best way to load static, local data into UITableView

开发者 https://www.devze.com 2023-02-08 03:07 出处:网络
I have some static data that is going to be shipped in my iPhone app\'s bundle. It is updated very rarely (about twice a year) and the app will not be doing any networking. I\'m going to update the da

I have some static data that is going to be shipped in my iPhone app's bundle. It is updated very rarely (about twice a year) and the app will not be doing any networking. I'm going to update the data manually when these changes occur.

I want to know what the best way to load this data is. I've already started using an XML file and parsing it as needed, but it's a huge amount of data to do this with. I'm finding it tedious. There are about 120 pages worth of stuff, with images etc. Just not fun.

I've heard about core data, but I don't really know if it's going to do what I want. I want to find a way to just create a UITableView controller and a detail view, then somehow bind the data to these controllers. (a teensy amount of example code would be appreciated for this part)

If anyone has any suggestions, please feel free to leave an answer or comment.

Here's a sample of my XML:

<?xml version="1.0"?>
<jftut>
    <heading name="Introduction">
        <subheading>Jungleflasher Overview</subheading>
        <subheading>Before Using Jungleflasher</subheading>
    </heading>
    <heading name="Which Drive do I have?">
        <image>DriveIdentification.png</image>
    </heading>
    <heading name="Drives">

        开发者_运维百科<manufacturer name="Samsung">
            <version>MS25</version>
            <version>MS28</version>
        </manufacturer>

        <manufacturer name="Hitachi">
            <version>32 through 59</version>
            <version>78</version>
            <version>79</version>
        </manufacturer>

        <manufacturer name="BenQ">
            <version>VAD6038</version>
        </manufacturer>

        <manufacturer name="LiteOn">
            <version>74850c</version>
            <version>83850c v1</version>
            <version>83850c v2</version>
            <version>93450c</version>
        </manufacturer>
    </heading>

</jftut>

Below each of those bottom nodes will be an article detailing how to perform a task related to them.

If the question needs more detail, just ask :)

Thanks,

Aurum Aquila


I think core data will serve your purpose in a flexible way.You said updation is rare, even if it is not so, it would'nt be tedious while using core data,where entities are mapped in to objects and assigning values will automatically update db without writing a single line of sql statement. I want to know in which format is your data.


First of all store all your local data in a sqlite file.Then you can use use core data as a wrapper for all your operation.

For reference you can follow tutorial 1 & Tutorial 2

0

精彩评论

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