Should I define overloaded inherited method in the header file in ObjC?
well th开发者_开发技巧e question is the one I put in the title: "Should I define overloaded inherited method in the header file in ObjC?"
Thanks
UPDATE: I was wondering this because I will make my project's documentation using Doxygen, and maybe is better to declare overloaded inherited method because of the documentation. For example for method like compare or isEqual, something like that.
Normally, no. You'd only declare an overridden method in the header (and explain it in the documentation) when you make it do something significantly different from the superclass implementation. There are a few examples of this in the Apple docs.
Also, overloading means something very different (methods with same name taking/returning different types). Objective-C does not have it.
I don't believe that Apple does, and really it's only beneficial for explicit clarity.
UPDATE: Doxygen will automatically include inherited member functions, for example: http://dysart.cs.byu.edu/CHDataStructures/class_c_h_ordered_dictionary-members.html
So declaring it an overloaded method would only be beneficial if you need to add extra documentation to the method.
精彩评论