just another question for Unit testing. In one of my iOS Projects doing Unit tests, it is necessary to use a UIWebView. When i create one in - (void)setUp;
or any test method, the whole Test crashes without any further information. The Debug Navigator shows only: 0 pthread_mutex_lock
I don´t do anything with locks or multithreading at all. I´ve tried to synchronize it with the same error. I´ve also tried a completely different and new project with the same behavior. This happens only when i try to alloc a UIWebview. I´ve tried to alloc UIViews as well as UIViewController and all did fine.
So my questions are:
- Why does this happen?
- How can i resolve this Problem?
The only way i see here is to use a Framework like OCMock to mock a web view. But i like to know why my tests are crashing this way...
Thanks in advance, Tomte
UPDATE: I still have this Problem in Xcode 5 as well in Xcode 4. I tried to use a mock with OCMock but i didn´t get rid of the delegates of the original UIWebView. If anyone has an example how to use a mock with all the delegates, then feel free to tell me...