Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between category and extension in objective c?

Answer Posted / Sumit Sharma

Both categories and extensions allow developers to add new methods to existing classes without modifying their original source code. However, there are some differences:n1. Category: It can be applied to any class at runtime, even if the class was not originally designed for the category. Categories have a separate header file (extension) that defines the interface and implementation of the new methods. They can also share the same name with other categories or extensions.n2. Extension: It is only available in Objective-C 2.0 or later versions, and it can be applied to any class, protocol, or namespace during development. Extensions should be used for adding properties and methods to a class that was designed for them. They must have the same name as the original source file.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category