How do I override Apple's default hints to explain what I'm doing in the method?

Discussion in 'Mac Programming' started by moonman239, May 28, 2015.

  1. moonman239 macrumors 68000

    Mar 27, 2009
    In my code, I override UIView's removeFromSuperview method. Now, I'd like to make some changes so that when I'm sending the removeFromSuperview message to an instance of this UIView subclass, I can see my own explanation of what the method does, rather than Apple's explanation.

    Please feel free to ask for clarification. I didn't get enough sleep last night.
  2. ArtOfWarfare macrumors G3


    Nov 26, 2007
    I'm pretty sure all you need to do is add some specially formatted comments to your method declaration. You can look at any of the SDK header files to see what they look like. They're inspired by Java's Javadoc comments - in a lot of cases the two are identical.

    Note that I've never actually bothered with having such polished documentation for Obj-C code. If it doesn't appear in Xcode, there may be a command line tool you need to use which will produce actual documentation libraries using your specially formatted comments in your code and load them into Xcode.
  3. SomeWhores macrumors newbie

    May 11, 2011
  4. moonman239 thread starter macrumors 68000

    Mar 27, 2009
    Thanks, but that's not what I was looking for. Because I am simply overriding an Apple-provided method, I'd rather not declare the method in my subclass's header file.
  5. chown33 macrumors 604

    Aug 9, 2009
    I would. I'd redeclare it with a comment that said "override". Think of it as compiler-checked documentation of programmer intent.

Share This Page

4 May 28, 2015