Is it possible to create classes dynamically in Objective-C?
I want to do something like this, but dynamically:
Mission *mission = [[Mission alloc]init];
mission.Id = [modelObject Id];
mission.EntityState = [modelObject EntityState];
mission.Description = [modelObject Description];
So I tried this
id clonedobject = [[[modelObject class] alloc]init];
for (NSString *key in dic)
{
[[clonedobject valueForKey:[dic objectForKey:key]] addObject:[modelObject valueForKey:[dic objectForKey:key]]];
}
But with this code, I cannot reach for example the id with clonedobject.Id. It says "Property ID not found on object of type id.
Is there a way to do something like this?
[modelObject class] *clonedobject = [[[modelObject class] alloc]init]