I know I’m not supposed to do this in a unit test but as a learning test how would one go about making an NSURLConnection in a GTMSenTestCase? According to all the docs I’ve read for an NSURLConnection to work correctly the calling thread’s run loop must be operating in default mode. Does that mean I’ll have to setup my own RunLoop to get things working correctly? I thought I read somewhere that GTMSenTestCases don’t execute on a runloop and that their runloop needs to be manually set. Help?
Advertisement

Yes, or, at least, “SenTests” don’t work inside a runloop, you have to set one up, or you can do the URL request synchronously by using sendSynchronousRequest.
By: Jamie on February 15, 2009
at 2:30 am