What am I doing wrong here?
Created:
CustomTab.h
#import <UIKit/UIKit.h>
@interface CustomTab : UIView {
IBOutlet UIView *view;
}
@property (nonatomic, retain) IBOutlet UIView *view;
@end
CustomTab.m
#import "CustomTab.h"
@implementation CustomTab
@synthesize view;
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
// Initialization code
}
return self;
}
- (void)dealloc {
[super dealloc];
}
@end
- XIB file set its files owner to be CustomTab's class, hooked up the view
In my UIViewController class
- (void)viewDidLoad {
[super viewDidLoad];
CGRect frame = CGRectMake(0, 0, 320, 40); // Replacing with your dimensions
CustomTab *myObj = [[CustomTab alloc] initWithFrame:frame];
[self.view addSubview:myObj.view];
[myObj release];
}
The subview doesnt appear on the screen. What am I missing?