Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Difference between categories and inheritance??

prudhviprudhvi Posts: 41Registered Users
edited July 2011 in Tutorial Discussion
hi everyone,can anyone tell me the difference between categories and inheritance..categories are used to add the functionality to the existing class,but we can also do that using inheritance..then what is the use of categories..i searched this in google..but not got a satisfied answer..Thanks in advance..
Post edited by prudhvi on

Replies

  • DomeleDomele Posts: 2,991Registered Users @ @ @ @ @
    edited May 2011
    Subclassing will create a new class where the method exists. With categories, you can add a method to an existing class and use that class.
    If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.<br />
    <br />
    New app - See screenshots and details at <a href="http://www.globaclock.com"; target="_blank">www.globaclock.com</a>.<br />
    <br />
    If you want to
  • assistmanassistman Posts: 1New Users
    edited July 2011
    prudhvi wrote: »
    hi everyone,can anyone tell me the difference between categories and inheritance..categories are used to add the functionality to the existing class,but we can also do that using inheritance..then what is the use of categories..i searched this in google..but not got a satisfied answer..Thanks in advance..

    You use category to change the current class. All instances of that class you create after adding a category would implement the category method(s). So you actually lose access to the "old" class.
Sign In or Register to comment.