This should be easy as hell, but I can’t figure out the syntax on my own.
Couldn’t really formulate the question correctly so I couldn’t Google the answer. (you can get why with keywords like objective c, property, class)
Anyhow. In one of my classes I want to save a property which references another class, NOT an instance of another class. Which you easily can accomplish with this code:
@property (nonatomic, assign) Class anotherClass;
Although, I don’t want to use the generic Class. I want to use my own classes, but I can’t figure how, guess I’d like to do something like @property (nonatomic, assign) @class(MyOwnClass) myClass;
Objective-C does not allow for stack based objects. I don’t think you’ll be able to do this. You’ll have to store a pointer to an instance of a class. class is a method of NSObject, and returns a Class object, which is an instance of meta-class. This is why it works with just class, because you’re saving the instance of the meta class object.