My application has amongst other things a table view with living content. IE. On a daily bases my app checks in to my server to let it know the ID of the last update it has. With that my server prepares a json digest and passes it back to the iphone app.
This digest contains articles in html and IDs of old articles that are to be deleted from the device.
There's always a large-ish number of articles and the content is ever changing. It is not likely that a user will open all articles but if one is opened it is likely that that one will be opened several times.
So I want to download the text and formatting of each article fully and store. I've this working at the moment. So far so good. I use Core Data to store all of this for simplicity.
Each article may have 0 - n images. I don't want to download and store all the images every update. However, when an article is accessed I want to download and store the images associated locally so I only need to d/l images once.
I've read the guidelines for storing binary data in Core Data and it should be OK considering the number of images and the size of each. However - it is generally a good idea?
Second, Each article is html, inside the html code my images are referred to by path. How does that work when I pull a html string out of my core data object? what is my "path"?
In this case, where must I put "funny.jpg" on the iphone?
I control this system so if the change need to be to the html or the app it doesn't matter. These articles will only be accessed by my app as well so formatting the html in a way that will make it unreadable to other browsers is ok!
This digest contains articles in html and IDs of old articles that are to be deleted from the device.
There's always a large-ish number of articles and the content is ever changing. It is not likely that a user will open all articles but if one is opened it is likely that that one will be opened several times.
So I want to download the text and formatting of each article fully and store. I've this working at the moment. So far so good. I use Core Data to store all of this for simplicity.
Each article may have 0 - n images. I don't want to download and store all the images every update. However, when an article is accessed I want to download and store the images associated locally so I only need to d/l images once.
I've read the guidelines for storing binary data in Core Data and it should be OK considering the number of images and the size of each. However - it is generally a good idea?
Second, Each article is html, inside the html code my images are referred to by path. How does that work when I pull a html string out of my core data object? what is my "path"?
Code:
<img src="funny.jpg" />
In this case, where must I put "funny.jpg" on the iphone?
I control this system so if the change need to be to the html or the app it doesn't matter. These articles will only be accessed by my app as well so formatting the html in a way that will make it unreadable to other browsers is ok!