Unrecognized Selector SenTestCase for Category

前端 未结 4 1768
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 12:50

I created a new Cocoa Touch Static Library project with Unit Testing in XCode 4 and added a category:

// NSString+Inflections.h
@interface NSString (Inflect         


        
4条回答
  •  囚心锁ツ
    2020-12-20 13:16

    I was searching for an answer this problem myself and found (I believe) a simpler solution, which doesn't require remembering to add a reference in the Compile Sources list whenever a new category class is added to the project.

    In the test target's build settings, add -ObjC to the Linking / Other Linker Flags value.

    Further explanation for why this error actually happens can be found at Apple Reference.

提交回复
热议问题