tags:

views:

59

answers:

2

What is the objective-c syntax for documenting a method's usage? Is this done in the .h or .m file?

In C# one uses something like:

/// <summary>
/// Executes an HTTP GET command and retrieves the information.  
/// </summary>
/// <param name="url">The URL to perform the GET operation</param>
/// <param name="userName">The username to use with the request</param>
/// <param name="password">The password to use with the request</param>
/// <returns>The response of the request, or null if we got 404 or nothing.</returns>
protected string ExecuteGetCommand(string url, string userName, string password) {
...
}

Is this done with the #pragma directive?

Thanks,

Craig Buchanan

+3  A: 

Objective-C doesn't have a built-in documentation feature. Apple includes a tool called Headerdoc that can generate docs from source files, but there are several better options. I think the most popular is Doxygen, in which case the syntax is the Java-style /** Documentation here */. You can check out the Wikipedia page for examples of how it's used (albeit with other languages). Apple has instructions for using Doxygen with Xcode on its site.

Chuck
A: 

ObjcDoc gives an example.

mcandre