What is the difference between inheritance and category

what's the difference between inheritance and category in objective-c

Both are used to subclass! So what is the difference between the two.

+3
source share
2 answers

While Category is a great way to add functionality to a base class, people like me who come from other object-oriented technologies like Flash will be a little complicated in understanding how this thing relates to the inheritance chain. The same question came to my mind, and I quickly studied the subject.

The last thing is that a category does the same thing as about itself. It adds functionality to the base class. If you remember this, then there will be no confusion.

, , , . , A, B - A. B . A, "A + newRole". , A. , , A, B, . . , . , , Category .

+8

, , , .

, .

+4

All Articles