I have been using GDataXMLNode.m provided by Google in Objective-C, and I’ve noticed that they do an @class forward declaration in their implementation (.m) file. They do this:
@class NSArray, NSDictionary, NSError, NSString, NSURL;
Why is this? Is there any real optimisation created by doing this?
I don’t think they play any role in compilation, since they are present as well in the
.hfile, so they are simply a duplicate. Furthermore, the.hfile already importFoundation.h, thus those forward declarations are simply redundant.Maybe they are used as a form of documentation of dependencies that
GDataXMLNodehas with other classes.