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

moonman239

macrumors 68000
Original poster
Mar 27, 2009
1,524
22
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.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,689
4,301
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.
 

chown33

Moderator
Staff member
Aug 9, 2009
8,762
5,114
vertical
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.
I would. I'd redeclare it with a comment that said "override". Think of it as compiler-checked documentation of programmer intent.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.