0

ViewDidAppear method I put breakpoint in the last step of the operation, but the breakpoint viewDidAppear method of putting at first, trying to run it directly. Are emerging in connection using WebService. Be the first breakpoint while running webservice connections, calling the latest viewDidAppear. However, prior to providing breakpoint viewDidAppear when calling WebService connection, and this causes the value NULL to return. In short, I would like to be called viewDidAppear method, after obtaining all the webservice connections. Breakpoint when it's like this, but when I want to work in the same way.

- (void)viewDidAppear:(BOOL)animated
{
[self LabelYukle];
[super viewDidAppear:animated];
}

-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
if(theConnection)
    [webData setLength:0];
}

1 Answers1

0

viewDidAppear is called by iOS system on its own just before view is going to be appeared. If you want to perform some functions after didReceiveResponse method, there is a method in NSURLConnectionDelegate that can help you.

- (void)connectionDidFinishLoading:(NSURLConnection *)connection

This method is used when a connection has finished loading successfully and you can write the functions you want to perform after didRecieveRespose here in this method.

You can read more about NSURLConnectionDelegateProtocol methods here.

Puneet Sharma
  • 9,369
  • 1
  • 27
  • 33
  • Puneet, I have another question, can provide multiple web service connection can happen in a certain order? Control over the connection NSURLConnection are we able to? – Burak Benli Oct 07 '13 at 08:27
  • You can create multiple NSURLConnection objects. But to maintain a certain order you need to try different things as it is asynchronous in nature. You can try the solution provided here:http://stackoverflow.com/questions/9062393/how-can-we-handle-multiple-nsurlconnection-in-iphone-xcode – Puneet Sharma Oct 07 '13 at 08:38