Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:20:12+00:00 2026-05-27T17:20:12+00:00

I am trying to call a web service on page load. Currently I call

  • 0

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.

Here is my code for submit button and ViewDidAppear:

-(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&cardno=%@&password=%@",username.text,password.text];
[handler sendingLoginRequest:url Respond:self At:@selector(showParsed:)];    
}

and for viewDidAppear

-(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];
}
}

What should I do? Please help…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:20:13+00:00Added an answer on May 27, 2026 at 5:20 pm

    A couple things could be the problem here.

    1)

    IBActions usually take a parameter. Declare it as:

    - (IBAction) submitButton: (id) sender;
    

    And then call it from your viewDidAppear method as:

    [self submitButton: self];
    

    2)

    Also make sure UI stuff is happening on the main thread (you didn’t specify if the app is multi threaded or not), so maybe:

    [self performSelectorOnMainThread: @selector(submitButton:) withObject: self];
    

    And

    3)

    Set breakpoints to see if your submitButton method (and the lines before it) are actually even called when viewFromAppear: is called.

    And Rishi’s suggestion is good, too!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call a web service from asp.net 3.5 application. I have
I am trying to call a web service (using nusoap ), which work well
I'm trying to call a web service in VFP 9.0 SP2. The site hosting
I using VB.NET 2.0. I am trying to call a web service. This web
I'm running into this problem when trying to call a SOAP Web Service from
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
We're trying to use Axis2 to call a web service that cannot use HTTP/1.1
I am trying to make a web service call from PHP to a SOAP
I'm trying to work out what a BizTalk call to a web service is
I am trying to make a web service request call to a third part

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.