5

I'm using headerDoc tags in XCode and can't seem to document private methods in .m files. Using sample syntax straight from Apple's site:

@implementation AppDelegate

/*!
 This is an objective-C method.
 @param application
 Parameter A.
 @param launchOptions
 Parameter B.
 @result
 Results in global warming.
 */

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

}

Results in the following error:

Processing compassview/AppDelegate.m
/Users/me/workspace/iOS/myapp/AppDelegate.m:inputCounter: warning: Class braces do not match.
We may have a problem.
/Users/me/workspace/iOS/myapp/AppDelegate.m:194: WARNING: anonymous type.
IC: 181
DC: "end  
"
TL: ""
NL: "end"
PT: ""
/Users/me/workspace/iOS/myapp/AppDelegate.m:194: warning: Unknown keyword  in block-parsed declaration.
This usually means that your code requires C preprocessing in order to be
valid C syntax and either C preprocessing is not enabled (-p) or the required
macros lack HeaderDoc comments.  Use of the @parseOnly tag is recommended
for these special symbols.

headerDoc tags outside the @implementation block work without this error.

Brendenw
  • 785
  • 1
  • 6
  • 22
  • 1
    Looking over my headerDoc tags, I noticed that they are all in an @ interface in the header file. Have you tried using an @ interface () section in your .m file and then declaring the private methods? – JScarry Mar 04 '15 at 18:27
  • 1
    Well that approach works. But it means some duplication and separation of comments from the actual method implementation. Looking through Apple's own sample code, I don't see they use that approach. – Brendenw Mar 04 '15 at 18:52
  • I've found the same thing. The only way I can make it work is to put declarations and headerdoc comments in an interface section. This really sucks because now the documentation is separate from the methods, neatly defeating the entire purpose. – Jeremy Oct 13 '15 at 00:16

0 Answers0