In my Project, I have a customised @interface GraphView: UIView. Hence GraphView is a subclass of UIView and is meant to show a graph.
Then, I create a new View Controller called Summary using a NIB. In the Interface builder, I just add a UIToolbar at the bottom of the View.
In the implementation of Summary, in the viewDidLoad method, I have the following code:
-(void)viewDidLoad {
[super viewDidLoad];
GraphView *myGraph = [[GraphView alloc]init];
[self.view addSubview:myGraph]; //this does not work
}
But I am unable to get this.
I believe you need to set the frame of
myGraphbefore you add it as a subview toself.