If I understand correctly you can do the following:
-(int) reconnectToServerForClass:(UIViewController *)myClass
{
//myClass.view
}
or inside the method
-(int) reconnectToServerForClass:(id)myClass
{
if([myClass isKindOfClass:[UIViewController class]])
{
UIViewController *viewController = myClass; //edit as suggested by Peter Segerblom
//viewController.view
}
}
Which ever option you choose is that it will depend on how you use it and how you want to manage or limit the callers, in option 1 the parameter must be a sub class of UIViewController
and the same for option 2 but the difference is that you can pass in anything but if the type is not UIViewController
it will just do nothing.
Disclaimer: This code is not tested and typed from memory, so it might not compile, let me know if you come across issues and I will edit answer.