How to avoid accidental overriding method or property in Objective-C

前端 未结 4 1460
轮回少年
轮回少年 2021-01-04 05:47

For instance, I subclassed UILabel and added a method or property called -verticalTextAlignment to align text vertically.
And in the future, if

4条回答
  •  天涯浪人
    2021-01-04 06:36

    An elegant solution is to check for the method being already there and only adding it if it isn't: Conditional categories in Mountain Lion

提交回复
热议问题