0 votes
10 views
Limitations and problems with category in Objective-C?
in Technology by (190k points)

1 Answer

0 votes

Advantages: You can extend any class, even those, for which you do not have the source. Look, for example, into the UI extensions added by Apple to the NSString class for rendering, getting the metrics, etc. Since you have access to all instance variables, categories provide you with a nice way to structure your code across compilation units using logical grouping instead of the “it must all be in one phyiscal place” approach taken, for example, by Java. Disadvantages: You cannot safely override methods already defined by the class itself or another category.

by (190k points)

Related questions

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