3

I have two classes say A and Band I want to create objects of any one of these classes depending upon some condition. Can I create a custom class cluster for this? If YES, how? I know that NSMutableArray also works on the same principle.

Jano
  • 62,815
  • 21
  • 164
  • 192
Ankit Srivastava
  • 12,347
  • 11
  • 63
  • 115
  • 2
    You could take a look at [this](http://stackoverflow.com/questions/1844158/what-exactly-is-a-so-called-class-cluster-in-objective-c) question, and especially Frank C.'s answer. – Monolo Jan 11 '13 at 09:45

1 Answers1

-2

What you are looking for is a class cluster pattern, you can find many examples here on SO as well as on the Apple Dev pages itself. Have a look into a simple example of this pattern given here by @Frank C.

Community
  • 1
  • 1
Kris
  • 5,714
  • 2
  • 27
  • 47