Why would one use nested classes?

Viewed 823

Been doing objective-c for 5 years, so please bear with me.

I'm struggling to find documentation that clearly explains why you would want to nest a class definition, inside of another.

If I had two classes like the following, it makes sense to me that they are declared above and below each other. You may even want to have a nested property that references the other.

class DataImporter {
     }

class DataGenerator {
     }

But I don't understand why a nested arrangement like the following would be useful.

class DataImporter {
     class DataGenerator {
     } }
1 Answers
Related