I have a custom UIView
which I am loading in this manner
- (id)initWithFrame:(CGRect)frame withDelegate:(id)del
{
self = [super initWithFrame:frame];
UIView *myView;
if (self)
{
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
owner:self
options:nil];
for (id object in nibViews)
{
if ([object isKindOfClass:[self class]])
myView = object;
}
myView.frame = frame;
myView.backgroundColor = [UIColor clearColor];
[self addSubview: myView];
}
self.delegate = del;
return self;
}
On loading the view like this when UIView method returns self
all the outlets linked in the Interface Builder
are nil
. Is it not the right way ?