I have a class that is a UIViewController, so in my ‘MyViewController.h’ I have:
@interface MyViewController : UIViewController
However, in ‘MyViewController.m’, if I try and override loadView, -(void)loadView doesn’t autocomplete and since my view isn’t showing up, I believe that this is hinting at the problem.
I’m sure I’m doing something stupid but I can’t find anything on the matter.
Here’s my loadView if it helps:
-(void)loadView
{
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
myInputView = [[MyInputView alloc] initWithFrame:CGRectMake(0, 0, screenWidth,screenHeight)];
myInputView.delegate = self;
myInputView.style = kGestureInputStyleFading;
myInputView.backgroundColor = [UIColor redColor];
}
Thanks in advance!
Don’t worry about autocompletion. Simply define your
method and compile your app… If it does not work, please add some code so that we can see what is happening.
In loadView you are expected to initialize the
viewproperty of your view controller:In your case: