Objective-C casting of custom classes

602 Views Asked by At

Let say I have a custom class named as:

classA

and I have another custom class named as:

classB

How could I cast classA to classB?

1

There are 1 best solutions below

0
On BEST ANSWER

Same way as C/C++:

ClassA* objectA = [[ClassA alloc] init];
ClassB* objectB = (ClassB*) objectA;