I'm working on a core data based app for iOS, that pulls in images (web or local) or text (web or local). The data is added dynamically.
Note: Im dealing with basically strings here, when i say images i just mean storing the links or the local filename and not the image binary itself.
I can create two entities one for simple text and another for image names, Instead, i just wanted to create a single entity that would handle all kinds of data thats pulled..
Example:
Basically, I thought i'd save the actual data in NSString. In the case of an image, that would be the File URL/Name With extension, and for simple texts, it'll have just strings.
the Metadata will have the actual like type=(image or text); src=(URL of image or simply nil).
Based on this type of metadata i'd have a different layout in the tableViewController, or at least thats whats the plan.
Why i'm taking this approach is the simplicity it would bring AND if i decide to add video links! metadata as type=video/url=http://www.youtube.com/xsdg?= something like that.
What do you guys think? Im worried on the scalability factor here, Im afraid Im not capable of doing an outstanding job (yes I'm a par timer).
A suggestion on what the metadata should look like would be great! What if an entity has multiple images? how should i store that in metadata.
What more precautions should i take here?
Im also worried about memory issues when I use all this in tableView Cell, I'd have to create an effective imageStore class that handles all that.
thanks
Note: Im dealing with basically strings here, when i say images i just mean storing the links or the local filename and not the image binary itself.
I can create two entities one for simple text and another for image names, Instead, i just wanted to create a single entity that would handle all kinds of data thats pulled..
Example:
Code:
UniversalEntity{
data: NSString;
metadata: NSString;
lastModified: NSDate;
}
Basically, I thought i'd save the actual data in NSString. In the case of an image, that would be the File URL/Name With extension, and for simple texts, it'll have just strings.
the Metadata will have the actual like type=(image or text); src=(URL of image or simply nil).
Based on this type of metadata i'd have a different layout in the tableViewController, or at least thats whats the plan.
Why i'm taking this approach is the simplicity it would bring AND if i decide to add video links! metadata as type=video/url=http://www.youtube.com/xsdg?= something like that.
What do you guys think? Im worried on the scalability factor here, Im afraid Im not capable of doing an outstanding job (yes I'm a par timer).
A suggestion on what the metadata should look like would be great! What if an entity has multiple images? how should i store that in metadata.
What more precautions should i take here?
Im also worried about memory issues when I use all this in tableView Cell, I'd have to create an effective imageStore class that handles all that.
thanks