- Create from class name
- Create from class object
Classes are objects as well in objective C. Hence a classs object can be created using class name. Once
a class object is created, an normal object can be created from the class object.
eg.
[[NSClassFromString(className) alloc] init...]
2. Create from class object
The class object can be created from the typical object by sending the class message to the object. Once
the class object is created, the typical object can be created from the class object using the typical alloc
and init way.
eg.
Class classForElement = [MyUserClass class];
id newObject = [[classForElement alloc] init];
MyUserClass* object = (MyUserClass *) id;
id newObject = [[classForElement alloc] init];
MyUserClass* object = (MyUserClass *) id;