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

  • Home
  • SEARCH
  • 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 8367659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:12:53+00:00 2026-06-09T13:12:53+00:00

I am a fairly new IOS developer – on the whole everything is going

  • 0

I am a fairly new IOS developer – on the whole everything is going well except…..

I have a program that keeps a list of codes. I can hit a ‘+’ to add a new code and the new view calls a web service to validate the data, and if valid adds it to an internal sqlite database. So far so good.

On entry to the application, a dataview gets updated with all the codes in the database. Again good. If the user selects one of the codes, what is supposed to happen is;

Call another service to get detailed data from a database (SQL server if interested).
Put this data into a initialised table.
Display the data in another view.

The code I am doing is as follows;

In prepareForSegue on first window, I get the code I need and put it into the second view instance.
I clean and prepare the database then exit prepareForeSeque.
All of the above is working!

The viewDidLoad on the second view controller is then called.

It gets the passed in variable, constructs the service request and calls the service.
It then exits and then the another dataview calls the numberOfRowsInSection – which returns zero because the callback from the service which processes the XML data and shoves it in the database has not yet been called!

I did try making a semaphore variable and set it in the service callback once it has processed the data. Then in viewDidLoad I spun waiting for this variable to be set. I spun using [NSSthread sleepForTimeInterval:0.25] but have a suspicion that I am blocking the service callback from being called.

I could ‘cheat’ I believe by putting an intermediate view between my main and sub view – and manually issue the segue to the sub-view – but suspect that this is an overkill!

Stan

  • 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-06-09T13:12:55+00:00Added an answer on June 9, 2026 at 1:12 pm

    You need to call [self.myTableView reloadData]; inside the completion block or delegate method of your web service request.

    What are you using for the web service calls? I have developed a pretty robust and simple NetworkClient using AFNetworking. All the web service calls have completion blocks where I deal with the data I get back. It will handle dictionaries or arrays from the web service and can do sync or async calls. It also has an optional built in APIKey that can be set and passed along to the web service for additional security. All the web service has to be able to do is handle form POST requests and it works flawlessly.

    I do what you are talking about all the time and I just build the array that supports the tableview and then call the reloadData method on the tableview.

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

Sidebar

Related Questions

I am fairly new to iOS development. I have a viewController that contains a
I'm fairly new to iOS programming, but have a basic understanding of it. I
I'm fairly new to iOS development, and I'm starting work on an App that
fairly new to Objective-C and iOS development (coming from PHP) and I have a
I am a bit new to iOS development and have a fairly general question
I am fairly new to iOS development and trying make a simple app which
I'm fairly new to ARC for iOS (and pretty new to iOS in general)
I am fairly experienced C programmer but IOS is new for me. I do
fairly new iPhone developer here. Building an app to send RS232 commands to a
Fairly new to Azure and the whole worker role concept, previously if I wanted

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.