I need to move the same method from 4 different classes to the superclass. Such methods are exactly the same except for the type of a variable declared in them:
例如,在第一类方法中,
FirstClass var = [[FirstClass alloc] init]
第二类
SecondClass var = [[SecondClass alloc] init]
等等。
如何以最佳方式在超级阶级中实施这一变化?
Should I use NSClassFromString in the superclass and get each string from each method in the subclasses?
thanks