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 3951276
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:42:43+00:00 2026-05-20T01:42:43+00:00

i am getting the web services from the .net web server. while in the

  • 0

i am getting the web services from the .net web server.

while in the process (getting data) i am displaying a subview with activity indicator.

After completing getting data i need to close that view.

i have two classes one is myclassviewcontroller,webservices

Basically i am writing code to get web services webservices.

In webservices class at

-(void)connectionDidFinishLoading:(NSURLConnection *)connection i call myclass like this.

myclassviewcontroller *obj = [[myclassviewcontroller alloc]init];
[obj mymethod];

At myclassviewcontroller i write this code for my method.

  • (void)mymethod {

    [loadview removeFromSuperview];
    }

the method is executed but view is not removed.

I already declared it in myclassviewcontroller.h class also.

i am checking this by keeping some text in NSlog

But if i calling this mymethod in myclassviewcontroller.m using timer then it removes view.

what the wrong.

can any one please help me.

I think it may be understand what is my problem.Let me place comment if not.

Thank u in advance.

  • 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-20T01:42:43+00:00Added an answer on May 20, 2026 at 1:42 am

    I believe the problem with your code is how you access the myclassviewcontroller. It must have already been on the screen while the data was loading, so creating a new instance of that class and calling a method against one of it’s uninitialized members (loadview) does nothing.

    myclassviewcontroller *obj = [[myclassviewcontroller alloc]init];
    // here object has just been initialized 
    //    (it is not the same instance as the one on screen)
    [obj mymethod];
    

    If obj was a reference to the actual viewcontroller that is on screen, you could easily call:

    [obj.loadview removeFromSuperview];
    

    or

    [obj mymethod]; // if you wanted to add more code in that function
    

    So, the real problem is that you accessing a different instance of myclassviewcontroller than the one which is actually on screen. You need a variable holding some reference to the correct instance of myclassviewcontroller to access the loadview ivar.

    In webservices.h:

    @interface webservices : NSObject {
    ...
    
    // This ivar will have to be set when webservices is initialized
    myclassviewcontroller * viewController;
    }
    @property (nonatomic, retain) myclassviewcontroller * viewController;
    

    and webservices.m would need to @synchronize viewController.

    Then in connectionDidFinishLoading: you can just call [viewController.loadview removeFromSuperview];

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

Sidebar

Related Questions

I have a rather simple web-service which exposes data from sql server. It will
I'm using Fedex's web services and getting an annoying error right up front before
Can anyone suggest a way of getting version information into a Web Service? (VB.NET)
I am getting ready to completely overhaul my web server. I use it for
After getting pretty far along with a jQTouch web application for our website, my
We just started a new ASP.Net project that uses web services to serialize some
I'm getting a 404 error when trying to run another web service on an
So, I'm getting some compile errors on netbeans 6.5 generated web service code for
While accessing a webservice which is availbale at http://recpushdata.cyndigo.com/jobs.asmx , I am getting this
I am getting a web host and i have projects with teammats. I thought

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.