1

I have a call out to a restful API. I need to wait for the call to complete before I can validate the results. Pretty common problem yet I cannot find a decent answer on how to incorporate this into an XCTestCase. I have seen semaphores, locks, for loops all cluttering up code to run what should be a simple case. Running iOS 7 in xcode 5.

There has to be an easier option.

JuJoDi
  • 14,627
  • 23
  • 80
  • 126
lostintranslation
  • 23,756
  • 50
  • 159
  • 262

1 Answers1

1

You can now use XCTestExpectation. Tutorial available on NSHipster: nshipster.com/xctestcase

Paul Ardeleanu
  • 6,620
  • 2
  • 40
  • 41