in Technology by
Limitations and problems with category in Objective-C?

1 Answer

0 votes
by

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.

Related questions

0 votes
    What is the use of 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
    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
    I realize a couple of basic differences between the two, i.e. EC2 is going to be cheaper RDS I wouldn't ... just high SELECT volume. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Are id and instanceType same? If not, what are differences between them in Objective-C?...
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
    What is the difference between #import and #include in Objective-C?...
asked Nov 10, 2020 in Technology 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
...