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

前端 未结 3 1355
爱一瞬间的悲伤
爱一瞬间的悲伤 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:15

    You have to have an @implementation for Show.

    Or you could use

    Show* s = [[objc_getClass("Show") alloc] init];
    ...
    

    or

    Show* s = [[NSClassFromString(@"Show") alloc] init];
    ...
    

    to resolving the class in run-time.

提交回复
热议问题