Why is Google making an @class declaration in the implementation (.m) file?

I used the GDataXMLNode.m provided by Google in Objective-C and I noticed that they make @class

forward declarations in their implementation file (.m). They do this:

@class NSArray, NSDictionary, NSError, NSString, NSURL;

      

Why is this? Is there any real optimization created with this?

+3


source to share


1 answer


I don't think they play any role in the compilation as they are present in the file as well .h

, so they are just duplicates. Also, the file is .h

already importing Foundation.h

, so these advanced declarations are just redundant.



Perhaps they are used as a form of documentation of dependencies that it GDataXMLNode

has with other classes.

+2


source







All Articles