How to call a web service on page load
<p>I am trying to call a web service on page load. Currently I call it on a button click and it works fine. But when I try to do the same on viewDidAppear, it doesn't happen. What i want to achieve is if username and password are saved then it should automatically load the next page. It is filling in the text boxes but not loading the next page.</p>

<p>Here is my code for submit button and ViewDidAppear:</p>

<pre><code>-(IBAction)submitButton{
[apd showCoverView:YES WithActivityIndicator:YES];
PlaceWebService *handler = [[PlaceWebService alloc]init];
[handler setRequestType:Loginparser];
NSString *url = [NSString stringWithFormat:@"http://www.mywebsite.com/api.php?command=auth&amp;cardno=%@&amp;password=%@",username.text,password.text];
[handler sendingLoginRequest:url Respond:self At:@selector(showParsed:)];    
}
</code></pre>

<p>and for viewDidAppear</p>

<pre><code>-(void)viewDidAppear:(BOOL)animated 
{
NSLog(@"Appeared");
[self loginArea];
apd=[[UIApplication sharedApplication]delegate];
NSString *filepath=[self pathOfFile];
if([[NSFileManager defaultManager]fileExistsAtPath:filepath])
{
    NSArray *array=[[NSArray alloc]initWithContentsOfFile:filepath];
    username.text=[array objectAtIndex:0];
    password.text=[array objectAtIndex:1];
            [self submitButton];
}
}
</code></pre>

<p>What should I do? Please help...</p>
