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

    Joined:
    Mar 27, 2009
    #1
    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

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    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

    Joined:
    May 11, 2011
    #3
  4. moonman239 thread starter macrumors 68000

    Joined:
    Mar 27, 2009
    #4
    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

    Joined:
    Aug 9, 2009
    Location:
    Brobdingnag
    #5
    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