Hello. I'm a newby to STV and looking for a interesting feature, that is core of my project, however can't find it.
What I need is to construct data definition based on object property. My model represented as:
@interface Note: NSObject @property ... name; @property (nonatomic, strong) NSArray *fields; @end
While fields declared as:
@interface Field: NSObject @property (nonatomic, strong) id value; @property (nonatomic, copy) NSString *type; @end
Use case is next: app fetches set of Notes from the backend. Every Note has number of fields of the same class but different content. In order to describe Field we have type property, that can looks like "number", "text", "date" and so on.
From samples I've understood, that it is possible to build DataDefinition with all the types I have, however it is kind of static.
So my question: is it possible to evaluate type of every Field object in runtime and then build correct DataDefinition?
In the end I need to have a table with list of cells for every Field object and correct type (i.e. date for "date", "text" for "url" and so on).
Thanks in advance!