3

I know how to write text to a file in the Project's document folder. But swift not allowing me to do the same with different location like User's desktop folder or anywhere else.

Is it impossible to write a file in desktop using swift or objective-c?

If so please explain why.

If not please tell me how to do so using playground

iamprem
  • 606
  • 2
  • 9
  • 23
  • Also: [What should I do if no one answers my question?](https://stackoverflow.com/help/no-one-answers) – Alexander O'Mara Feb 13 '15 at 00:21
  • @Prem I am experiencing the same problem. I think the problem is related to Yosemite I will post the solution If I find out how to solve it. – Leo Dabus Feb 13 '15 at 02:37
  • @LeonardoSavioDabus I found that, since playground is sandboxed we can not access files from Desktop. We can access only the files that are copied into that playground resource's folder. I've tried the same with xcode project and i was able to read/write text file from desktop. Hope it would help you. Pls let me know if u find any method to access from playground itself. – iamprem Feb 13 '15 at 05:05

0 Answers0