6

When I'm typing up a Cocoa object and calling a selector on that object, I sometimes can see 'documentation' or 'help' information about that method. For instance, as I type [NSArray alloc], I see two help hints. One for NSArray, and one for alloc. Both of these appear in the popup autocomplete suggestions listbox as I type the code.

How do I produce similar method/class decorated help hints which will appear when I type? I want to see my comments as I type my custom class name and custom methods. How can I do this?

For instance, C# provides this feature through XML documentation which can be placed before any method, class, or interface/protocol declaration.

Brett
  • 4,066
  • 8
  • 36
  • 50
  • 1
    _"I want to see my comments as I type my custom class name and custom methods."_ this is very useful. :) – Kjuly Sep 14 '12 at 02:42

1 Answers1

7

You have to create a “docset”. There are tools like appledoc for creating docsets from your comments. You could set up a build phase that runs appledoc on your code.

The problem is that there's no way to make Xcode 4 reload a docset except by restarting Xcode. So even if you run appledoc automatically as part of your build, you will have to restart Xcode to make it see the changes to your docset.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
  • +1 The appledoc framework does a great job of creating docsets that are first-class citizens in Xcode. – jlehr Sep 14 '12 at 02:57
  • Yeah; it was actually kind of surprising to me the first time I saw my docs side-by-side with Apple's. I wasn't certain I was ready for that.... Luckily, appledoc will also generate HTML. – Rob Napier Sep 14 '12 at 02:58
  • Huh, that's sort of a disappointing amount of work, but I suppose it is better than nothing! – Brett Sep 14 '12 at 02:59
  • If you want Apple to make it better, [open a radar for it](http://bugreport.apple.com/). I did. It'll get closed as a duplicate, but that's how they track the demand for features. – rob mayoff Sep 14 '12 at 03:01