0 votes
12 views

What is the use of category in Objective-C?

in Technology by (189k points)

1 Answer

0 votes

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

by (189k points)

Related questions

0 votes
1 answer 10 views
0 votes
1 answer 9 views
9 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 14 views
0 votes
1 answer 14 views
0 votes
1 answer 13 views
13 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 10 views
10 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 16 views
16 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 15 views
15 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 12 views
12 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 10 views
10 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 13 views
13 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 15 views
15 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 11 views
11 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 11 views
11 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 12 views
12 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 13 views
0 votes
1 answer 16 views
16 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 19 views
19 views asked Nov 10, 2020 in Technology by JackTerrance (189k points)
0 votes
1 answer 10 views
...