I am having problem with ViewDidLoad Method.I have one .Xib File in my app and 5 viewControlelr.And Each View Controller Contains some initialization and method calls.
Problem is at the startup all the ViewDidLoad method runs.
Is there any way i can do this just when my ViewController will be called and the View is Loaded on the screen?
What is the proper way in this case?
I tried like this code :
-(void)viewDidAppear
{
[ScoreWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://smwebtech.com/Pandit/web_service/getScore.php?u=aa"]]];
}
But my program is not reaching this method.Why?Am i missing something?Please take a look.
Use
viewWillAppearmethod instead. It is only called when the view is going to appear on screen.Or
viewDidAppearwhich is only called after the view appears on screen.EDIT:
Both
viewWillAppearandviewDidAppeartake a BOOL argument each:EDIT2:
These two delegate methods have their corresponding ‘opposite’ methods that you can override to release resources you allocate in the former methods: