Adding the same category to multiple classes

后端 未结 6 607
陌清茗
陌清茗 2021-02-07 03:25

I have an Objective-C category that I\'d like to add to multiple classes without duplicating the code contained in the category. I simply want to add the same methods to multipl

6条回答
  •  礼貌的吻别
    2021-02-07 04:10

    Why not make the shared code class level methods in a central class, that you simply call via shell methods in each of your categories?

    If your categories are storing associated references you could pass those into the class level methods to act on.

提交回复
热议问题