I am currently porting iPhone app to iPad application. Now in few screens of iPhone app all the UI is done via code with Visual Format Language. Now in iPad since UI is different I can simply do it via Interface Builder. Now how can I my app execute the loadView for iPhone app only & not for iPad ?
I tried below option
#define IS_IPHONE UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone
#ifndef IS_IPHONE
- (void)loadView
{
self.myView = [[MyCustomView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.view = self.myView;
}
#endif
- (void)viewDidLoad
{
// my other code
}
But for iPhone loadView is not getting called. Directly viewDidLoad method is executed.
Can anyone tell me how can I achieve this ? Thanks in advance.
You can do someting like this :