This is the code in my 1st UIView (where it should be shown):
IconView *iconView = [[IconView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)
numberOfColumns:3
iconSize:CGSizeMake(80, 80)];
[self.view addSubview:iconView];
And here is the code from the other UIView:
-(IconView *)initWithFrame:(CGRect)frame
numberOfColumns:(int)numberOfColumnsTemp
iconSize:(CGSize)iconSize
{
self.backgroundColor = [UIColor redColor];
self.frame = frame;
return self;
}
But the background doesn’t turn red. Even adding:
iconView.frame = CGRectMake(0, 0, 320, 400);
To the first view does nothing. Adding a regular UIView works.
Your initializer should look like this:
An initializer should return the anonymous type.
However I can’t tell if this answers your problem.