[Solved] How to convert an NSString to id or UIView objective-c iphone [closed]


This gets you a UIViewController loaded from a xib.

    Class vcClass = NSClassFromString (@"myUIView");
    UIViewController *detailViewController = [[vcClass alloc] initWithNibName:@"myUIView" bundle:nil];

If you just wanted a UIView object, just do:

    UIView* myView = [[vcClass alloc] init];

But really, as the three answers so far show it isn’t clear at all what you what. Can you be clearer? What are you trying to do?

solved How to convert an NSString to id or UIView objective-c iphone [closed]