adspace
What are all the difference between categories and subclasses in iOS operating system?
Answer Posted / Asad Ali
Categories and Subclasses are two ways to extend or modify the behavior of existing classes in iOS. The main differences are as follows:
1. Subclass: A subclass is a new class that inherits properties and methods from an existing class, and can override those methods. It creates a new entity with its own identity.
2. Category: A category adds methods to an existing class without creating a new subclass. It doesn't create a new entity but extends the functionality of an existing class. Methods added through categories are compiled into the same binary as the original class, but they don't have their own instance variables.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain parent-child context setup. How does it work? What are the advantages?
What is latest ios version?
What is dependency management tools?
Why do all model object attributes get marked with @dynamic and not synthesised?
What is the purpose of reuseidentifier?
How to handle concurrency problems in core data?
What is nsmanagedobjectcontext? What are the different concurrency types? Explain them.
What is latest xcode version?
What are transient properties?
What's the latest version of ios?
Why do all model object attributes get marked with @dynamic and not synthesised? What does @dynamic mean?
What are the different store migration options? How do they work?
In a single model, can I have few entities in one sqlite db file and remaining in another sqlite db file?
What is latest version of ios?