我在 XCode 中使用 headerDoc 标记,似乎无法在 .m 文件中记录私有方法。直接使用 Apple 网站上的示例语法:
@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 {
}
导致以下错误:
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.
@implementation 块之外的 headerDoc 标记可以正常工作而不会出现此错误。