Why use nested classes?

I have been doing objective-c for 5 years, so please bear with me.

I'm struggling to find documentation that clearly explains why you want to embed a class definition inside another.

If I had two classes, for example the following: it seems to me that they are declared above and below each other. You might even want to have a nested property that refers to another.

class DataImporter {
     }

class DataGenerator {
     }

But I do not understand why it is useful to use a nested layout such as the following.

class DataImporter {
     class DataGenerator {
     } }
+4
source share
1 answer

Namespacing. , (, DataGenerator). . DataImporter.DataGenerator, OtherClass.DataGenerator, .

Objective-C, 2 3 (: UIView). , SSView

private .

+4

All Articles