Couldn't create log directory

前端 未结 4 1989
借酒劲吻你
借酒劲吻你 2021-02-07 00:23

When I test my application on iPad it run perfectly i.e. call the database , create folder and perform other task but in console it show me

2015-05-12 1

4条回答
  •  难免孤独
    2021-02-07 00:28

    The problem is that you are trying to create a file in your app's bundle. The bundle is read-only in iOS (and you should treat it as read-only on Mac OS as well, even though it is possible to write to your app bundle in Mac OS.)

    Your code will work on the simulator because changing the app bundle is allowed on Mac OS, and the simulator runs under Mac OS.

    Change your code to use your documents directory, temp directory, or some other directory in your bundle and you should be fine.

提交回复
热议问题