Hello
I am getting a "no visible interface for UIView" on the last line in my code (underlined). can anybody explain why ? thanks
Kaps
I am getting a "no visible interface for UIView" on the last line in my code (underlined). can anybody explain why ? thanks
Kaps
Code:
//
// BIDSwitchViewController.m
// view Switcher
//
// Created by Kapil Kapur on 21/08/2013.
// Copyright (c) 2013 Apress. All rights reserved.
//
#import "BIDSwitchViewController.h"
#import "BIDYellowViewController.h"
#import "BIDBlueViewController.h"
@interface BIDSwitchViewController ()
@end
@implementation BIDSwitchViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.blueViewController = [[BIDBlueViewController alloc]
initWithNibName:@"BlueView" bundle: nil];
[self.view insertSubview:self.blueViewController.view atIndex:0];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
if (self.blueViewController.view.superview == nil)
{
self.blueViewController =nil;
}
else
{
self.yellowViewController=nil;
}
}
-(IBAction)switchViews:(id)sender
{
if (self.yellowViewController.view.superview == nil)
{
if (self.yellowViewController== nil)
{
self.yellowViewController = [[BIDYellowViewController alloc] initWithNibName:@"YellowView" bundle:nil];
}
[self.blueViewController.view removeFromSuperview];
[self.view insertSubview:self.yellowViewController.view atIndex:0];
}
else
{
if (self.blueViewController==nil)
{
self.blueViewController = [[BIDBlueViewController alloc] initWithNibName:@"BlueView" bundle:nil];
}
[self.yellowViewController.view removeFromSuperview];
[U][B][self.view insertSubView:self.blueViewController.view atIndex:0];
[/B][/U]
}
}
@end