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

前端 未结 10 1418
清酒与你
清酒与你 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:41

    I was also having the same problem. The Solution i found is ( in xcode 4.x):

    Go to : Target -> "Build Phases" -> "copy bundle Resources" Then add that particular file here. If that file is already added , delete it and add it again.

    clean the project and RUN. It works. :)

提交回复
热议问题