in Technology by

What is the use of category in Objective-C?

1 Answer

0 votes
by

You typically use a category to add methods to an existing class, such as one defined in the Cocoa frameworks. The added methods are inherited by subclasses and are indistinguishable at runtime from the original methods of the class. You can also use categories of your own classes to: Distribute the implementation of your own classes into separate source files — for example, you could group the methods of a large class into several categories and put each category in a different file. Declare private methods.

#import “SystemClass.h”

@interface SystemClass (CategoryName)

// method declarations

@end

Related questions

0 votes
    Limitations and problems with category in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Can we use both swift (.swft) and objective c (.h .m) in same xcode project ?...
asked Mar 9, 2021 in Technology by JackTerrance
0 votes
    Can we create Dynamic Classes in Objective C? If Yes, Explain how to create with a valid use case?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain when to use NSArray and NSMutableArray. Which one is faster and threadsafe in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Which UE category supports 64 QAM on the uplink? (a) Only category 5 (b) Only category 4 (c) Only category 3 (d) Category 3,4 and 5...
asked Oct 4, 2021 in Technology by JackTerrance
+1 vote
    How many operators are there under the category of ternary operators in C Programming?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    which of the following is a category of system software?a. operating system b. programming language c. utility ... of the above Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    How do I call Objective-C code from Swift?...
asked Mar 9, 2021 in Technology by JackTerrance
0 votes
    Explain the difference between Swift vs Objective-C.?...
asked Nov 30, 2020 in Technology by JackTerrance
0 votes
    What are benefits of collections views in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    How we can layout subviews in a view in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    What are the size classes in Objective-c?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Why create a custom view in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    What is bundle in Objective-c?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    What is posing in Objective C?...
asked Nov 10, 2020 in Technology by JackTerrance
...