The way it works is that normally if you reference a class in an interface, you have to #import that class' header file:
#import "OtherClass.h"
@interface MyClass : NSObject
{
OtherClass* someOtherClass;
}
@end
The @class statement allows you to skip importing the header:
@class OtherClass;
@interface MyClass : NSObject
{
OtherClass* someOtherClass;
}
@end
You still have to #import "OtherClass.h" in the implementation file if you use @class.
// Still need to import, but now any class importing MyClass.h
// does not automatically know about OtherClass as well.
#import "OtherClass.h"
@implementation MyClass
…
@end
When you #import "MyClass.h" somewhere else in a third class, that third class does not automatically include the header of the OtherClass class if you have used @class OtherClass; in the MyClass header. Therefore the third class has no knowledge of OtherClass unless it expressly imports the OtherClass.h header. This is helpful when writing a public API that should hide its implementation details (ie OtherClass) from the developer.
Forward declaration is considered good practice (if only because it has no downsides other than a slightly altered workflow) and is preferable to importing the class' header in another header file. This certainly helps prevent cyclic imports as mentioned by Phillip.
I don't know about Xcode but in Visual Studio (C++) class forwarding was also instrumental to speed up compilation in larger projects with hundreds of classes. That was because the VS C++ compiler spent quite some time resolving header dependencies