skip to Main Content

I’m trying to create an JSON file in xCode but somehow it makes an directory from it.

I create an empty file and name is: user.json.
When saving it turns into an directory (get’s that symbol ) and it is not possible to edit the file or creating any data in the file.

My xCode version is: 14.3.1.
App is for OSX / MacOS.

I’ll send an printscreen for showing the issue.

// printscreen

2

Answers


  1. Chosen as BEST ANSWER

    After searching some more i found the problem. The problem wasn't in xCode but on my iMac. The file extension json was connected to an wrong app. By connecting the json extension to Smart JSON Editor the problem was gone.

    Thanks for your trying and help.


  2. I can’t reproduce the problem from your description, but here’s the full set of steps that results in a new JSON file. My Xcode version is also 14.3.1.

    1. Here’s a random sample project:
      Sample Xcode project

    2. I right-click (or Command-click) on any folder and pick "New file…":
      Adding new file to the Xcode project

    3. Then, pick the "Empty" option:
      Adding an empty file in Xcode

    4. I enter your "user.json" name for the file:
      Picking a file name for a new file in Xcode

    5. And voi-la, the file is created and ready to be used. Xcode even recognizes it as a JSON file:
      New JSON file in Xcode

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search