Class Foo is implemented in both MyApp and MyAppTestCase. One of the two will be used. Which one is undefined

前端 未结 6 992
忘掉有多难
忘掉有多难 2020-11-28 22:16

Recently I started Unit testing my application. This project (in Xcode4) was created without a unit test bundle so I had to set it up. I have followed the steps from here: h

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 22:56

    For me, all I needed to do was uncheck the checkbox that makes the Foo class a member of the unit test target. It should not be a member of both targets, and should look like this:

    Target Membership

    In case you can't see the image, it's a screenshot of the Xcode "Target Membership" pane. There are two targets: one with an "A" application icon and the test name. The other is the unit test target, and has a unit test icon:

    Target Membership
    [X] Foo
    [ ] FooTests
    

提交回复
热议问题