I have a tabbed application with two tabs.
on the second tab, I plot a graph.
But every time I press this tab, the UIview is not getting refreshed.
I tried,
[self.view setNeedsDisplay]
inside
- (void)viewDidLoad
but still it was not refreshed.
I tried pasting the code from - (void)viewDidLoad
to -(void)viewDidAppear
But nothing happened.
Awaiting an answer.
Edit: The whole source code
- (void)viewDidLoad
{
//[self.view setNeedsDisplay];
Sensor_VisualizationAppDelegate *delegate = (Sensor_VisualizationAppDelegate *)[[UIApplication sharedApplication] delegate];
valuePass = delegate.valuepass;
timePass = delegate.timepass;
NSNumber *value1 = [valuePass objectAtIndex:0];
NSNumber *value2 = [valuePass objectAtIndex:1];
NSNumber *value3 = [valuePass objectAtIndex:2];
NSNumber *value4 = [valuePass objectAtIndex:3];
NSNumber *value5 = [valuePass objectAtIndex:4];
NSNumber *value6 = [valuePass objectAtIndex:5];
NSNumber *value7 = [valuePass objectAtIndex:6];
NSString *time1 = [timePass objectAtIndex:0];
NSString *time2 = [timePass objectAtIndex:1];
NSString *time3 = [timePass objectAtIndex:2];
NSString *time4 = [timePass objectAtIndex:3];
NSString *time5 = [timePass objectAtIndex:4];
NSString *time6 = [timePass objectAtIndex:5];
NSString *time7 = [timePass objectAtIndex:6];
OVGraphView *graphview=[[OVGraphView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.height, 300) ContentSize:CGSizeMake(960, 300)];
graphview.reverse=YES;
graphview.graphcolor=[UIColor colorWithRed:0.31 green:0.73 blue:0.78 alpha:1.0];
[self.view addSubview:graphview];
[graphview setPoints:@[ [[OVGraphViewPoint alloc]initWithXLabel:time1 YValue:value1],
[[OVGraphViewPoint alloc]initWithXLabel:time2 YValue:value2],
[[OVGraphViewPoint alloc]initWithXLabel:time3 YValue:value3],
[[OVGraphViewPoint alloc]initWithXLabel:time4 YValue:value4],
[[OVGraphViewPoint alloc]initWithXLabel:time5 YValue:value5],
[[OVGraphViewPoint alloc]initWithXLabel:time6 YValue:value6],
[[OVGraphViewPoint alloc]initWithXLabel:time7 YValue:value7]
]];
[super viewDidLoad];
}