A bit more complicated, but you can use a documentation system. I am using appledoc . You can put comments in your code corresponding to HeaderDoc or Doxygen . Therefore, consider the following method declaration:
- (id)initWithURL:(NSURL *)url path:(NSString *)path;
The structure of this commentary: (a) starts with /** , not just /* ; and (b) provide descriptions of @param and @return . When you do this, you can submit your code to one of these documentation mechanisms, and you will get a good set of documentation. It also includes a class hierarchy.
But, although we all know that we should document our code, in Xcode 5 we have a more compelling reason, as our comments are automatically integrated into the main Xcode help system in real time. By inserting these comments into your code, Xcode 5 now automatically shows you the documentation for your methods in the quick help window, as well as for Cocoa classes.
In response to your question about the ability to see the entire class hierarchy using appledoc , you can create and install a "docset" that you can show in the Xcode documentation browser (in Organizer in Xcode 4.x, in a separate Documentation window in Xcode 5), by going to the project folder by executing the following command on the terminal command line:
appledoc --project-name MyApp --install-docset --output ../ MyAppDocumentation.
In addition to creating a docset that you can view in Xcode, these documentation systems allow you to create documentation that you can provide to third parties (if you ever need to do this). Appledoc, in particular, is creating an Apple site similar to HTML documentation. For example, here is the documentation for the above method declaration.
This separate “command line docset build” is not as smooth as the “add” you expect, but I find that with the integrated analysis of the Xcode 5 documentation, I personally integrated the documentation of my code in my development process. (I'm embarrassed to say that this was one of those things that I put off until the end of the development process.)