i want to add an UIView
for small size as a subview to existing view.
i have a UIViewController
pushed with a nib name which is the main vi
UIView *view = [[UIView alloc] init];
UIView needs to be alloc'ed and init'ed with a frame:
CGRect frame = CGRectMake(x, y, width, height); // Replacing with your dimensions
UIView *view = [[UIView alloc] initWithFrame:frame];
To add something (rather important) to the answers above;
CGRect frame = CGRectMake(x, y, width, height); // Replacing with your dimensions
UIView *view = [[UIView alloc] initWithFrame:frame];
Then, you want to actually add it to the superview (assuming the view is self.view)
[self.view addSubview:view];