accessing a file using [NSBundle mainBundle] pathForResource: ofType:inDirectory:

前端 未结 10 1388
清酒与你
清酒与你 2020-12-02 07:56

I have a file paylines.txt added inside the folder named TextFiles which resides inside the Resources folder of my iOS project in Xcod

10条回答
  •  自闭症患者
    2020-12-02 08:44

    When I drag files in, the "Add to targets" box seems to be un-ticked by default. If I leave it un-ticked then I have the problem described. Fix it by deleting the files then dragging them back in but making sure to tick "Add to targets". enter image description here

提交回复
热议问题