0

I have 2 classes - A & B. There is another class C wich inherits Class A. During runtime for some reasons i need to swap Super Class A with Super Class B. I had gone through runtime.h & found class_setSuperClass(Class myClass,Class newSuperClass). But this depreciated from iOS 2.0.

is there any way to achieve the same functionality ?

EDIT : I think this is no way related to other possible duplicates [Dynamically change an object's superclass. All i am asking is there any alternative way to achieve same functionality as "class_setSuperClass" method ?

Thanks for your help in advance.

Community
  • 1
  • 1
iOSTech
  • 77
  • 1
  • 8
  • 4
    Not a answer, but really - why? What on earth would make this a good idea? What are you trying to achieve? – Adam Wright Jun 12 '14 at 13:04
  • It is possible, but I won't do it – Bryan Chen Jun 12 '14 at 13:04
  • @Bryan Chen - Can please let me know, how can you do it ? – iOSTech Jun 12 '14 at 13:11
  • @AdamWright- Class A & Class B has some UI Stuff. Class C needs Class A UI Stuff in one flow & Class B UI stuff in another flow. So i wanted to swap the classes. – iOSTech Jun 12 '14 at 13:15
  • @LakshmiSandeepKandula, what is the _some reason_? there is no such reason why you even think about it, not purely doing it. do you want crash, because that is how you get your app crashed. – holex Jun 12 '14 at 14:50

0 Answers0