Reputation: 35
How to declare a Class property in objective-c?
Like this:
@property Class praise_usersClass;
it's right?
Upvotes: 1
Views: 1898
Reputation: 9042
In Objective-C, Class
is a pointer type and essentially also an object. So you can define a property as type Class
just like any other object but you do not need to specify the pointer as it is part of the typedef
definition.
Your example is fine:
@property Class praise_usersClass;
But FYI, note that you haven't specified any attributes so the defaults will apply:
@property (atomic,strong,readwrite) Class praise_usersClass;
For more information: Are classes structs or struct pointer
Upvotes: 1