When creating an UIWebView inside an unit test I get EXC_BAD_ACCESS
:
-(void)test1 {
[[UIWebView alloc] initWithFrame:CGRectZero]; // EXC_BAD_ACCESS
}
Is there a special configuration to run units test that involve UIWebView?
I'm using OCUnit/SenTest on XCode 4.2.
Apparently this only happens when unit testing a static library directly. Most likely whatever UIWebView
needs is not loaded with an empty test host
.
When unit testing an app this doest not occur.
You can create an app target that is just for running your unit tests. Create a new empty application in the same workspace and set this as the Target for the unit test target. I call my app TestRunner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With