0

I have JSON web-service and my task is to parse the web service and store the data into UITableview.

I am parsing the web service using NSURLConnection methods.

After parsing the web-service i got the response what I wanted .

But the issue is that my UIViewController is calling UITableView Delegate and Datasource methods first and then it calls web-service so my UITableView doesn't get any response.

Even though I call the web-service first it calls all the UITableView Delegate and Datasource methods first and then web-service so my table view doesn't get any response.

After calling the web-service i get perfect response.

So if somebody knows any solution please help me. Thank you.

3 Answers 3

1

The other answers in this thread should solve your problem.

However, if you find that [self.tableView reloadData] isn't refreshing the data in your UITableView, check out my suggestion on this thread:

Fails to call delegate/datasource methods in UITableView implementation

I'm not sure if this is a quirk with iOS 8, but I've had a few occassions where just setting the table's dataSource and delegate in the code hasn't been enough.

Sign up to request clarification or add additional context in comments.

3 Comments

Then, I'm not sure. You could try copying the code I put in my XCode tutorial, and see if that points you in the right direction: mikesknowledgebase.com/pages/Services/WebServices-Page6.htm
Thank you but it is not working for me.My problem is not in calling delegate or datasource method of uitableview .It works fine.But the problem is it should get called after webservice calling so my table view will get some response which is not happening. All the methods written on that viewcontroller are get called and then at last my webservice gets called so table view is not getting any response. This is the issue
Thanks Mike the demo helped me.
1

After you get your response and populate dataSource just call

[self.tableView reloadData];

Comments

0

Just set the data-source and delegate of table view in the delegate of the web-service delegate or where you get the response and reload the table view.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.