Can anyone please explain me what does @class
declaration do in Objective-C and what are the cases in which we should use this declaration?
hope this will help little more
Above answer already state almost every thing , i would like to add some thing on it.
The @class Foo
is a forward declaration of the Foo class. It’s like telling the compiler, foo class exists So don't bother about it right now.
Note:- Class declaration becomes very critical when both class need each other. if we do usual #import statement then, we would have an endless loop of imports and Compilers don’t like endless loops. So we use @class Classname
.