Reputation: 13660
From withing a UIViewController that is tied to a UIView (drawn in a nib file), i try to add another view, as a subview to the first view.
In case you are confused: UIViewController -> UIView + GraphView (extends UIView)
So i am saying:
GraphView *myGraphView = [[GraphView alloc] init];
graphView = myGraphView;
[self.view addSubview:graphView];
[myGraphView release];
I have also tried with insertSubview
.
The UIView shows up and the GraphView subview is instantiated correctly (its properties are there and i can access its methods). But it never shows on the screen!
Its drawRect
method is never called (i have an NSLog
in there that never shows), even if i manually call [graphView setNeedsDisplay]
.
Does anyone have a clue?
Thanks a lot!!!
Upvotes: 0
Views: 731
Reputation: 3498
Doesn't look like you're setting the GraphView frame rectangle, it will not display if it's offscreen. Also you probably should be calling the UIView initWithFrame:
initializer if you aren't.
Upvotes: 1