Why can't code inside unit tests find bundle resources?

后端 未结 6 1574
猫巷女王i
猫巷女王i 2020-11-28 01:37

Some code I am unit testing needs to load a resource file. It contains the following line:

NSString *path = [[NSBundle mainBundle] pathForResource:@\"foo\" o         


        
6条回答
  •  温柔的废话
    2020-11-28 02:20

    if you have multiple target in your project then you need to add resources between different target available in the Target Membership and you may need to switch between different Target as 3 steps shown in the figure below

提交回复
热议问题