Sachin Bhardwaj

Sachin Bhardwaj

  • Tech Writer
  • 15.4k
  • 1.7m

Difference between categories and extensions?

Jan 19 2013 1:11 AM

Class extensions are similar to categories. The main difference is that with an extension, the compiler will expect you to implement the methods within your main @implementation, whereas with a category you have a separate @implementation block. So you should pretty much only use an extension at the top of your main .m file (the only place you should care about ivars, incidentally) — it's meant to be just that, an extension.


Answers (1)