GH-Unit for unit testing Objective-C code, why am I getting linking errors?

前端 未结 3 1352
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-19 02:57

I\'m trying to dive into the quite frankly terrible world of unit testing using Xcode (such a convoluted process it seems.)

Basically I have this test class, attempt

3条回答
  •  无人及你
    2021-01-19 03:24

    Somehow Apple's example works without duplicating the .m files in the target.

    Download Apple's unit testing sample code (iPhoneUnitTests.zip) here:

    http://developer.apple.com/IPhone/library/samplecode/iPhoneUnitTests/Introduction/Intro.html

    Click on the CalcTests target. Only CalcTests.m is in this target.

    Build the target. It builds without any link errors for CalcAppDelegate or other classes.

    What's the magic that makes this work?

提交回复
热议问题