Museer Ahamad Ansari
Museer Ahamad Ansari

Reputation: 5523

Could not rename “New Group” to “ My Group”. in Xcode10.2

I just created a group and want to rename it but getting unable to update popup. I know how to rename it from show in finder. but y Apple in Xcode 10.2 does not allowed it directly from Xcode?

Or

Am i missing something? enter image description here

Upvotes: 34

Views: 11504

Answers (9)

Yeahia Md Arif
Yeahia Md Arif

Reputation: 7916

First Restart Xcode. If restart doesn't work then check that is same group name already exist inside folder. If group exist then delete it. Hope this two process will help to solve this issue.

Upvotes: 0

look
look

Reputation: 677

Ok... When you create a group it also creates a folder there. If you delete the group, the folder will not be deleted. Then if you change your mind and create the group again, it will try to create the folder again. But since the folder exists, the OS will throw an error which Xcode just reports as an inability to create the group.

So just rename or delete the underlying folder and now you can rename the group. You can rearrange the files in Finder after that.

Upvotes: 0

Hossein
Hossein

Reputation: 847

I think its not related to xcode, its finder problem, because directory still exists and finder doesn't show that, you can see directory exists by entering ls in terminal.

How to solve this?

  1. Open terminal and navigate to parent directory of desired directory : cd ~/../parent or just right click parent directory and choose New Terminal at Folder
  2. Remove desired directory : rm -rf MyGroup

Now you can try to create your group with MyGroup name.

Upvotes: 0

PhillipJacobs
PhillipJacobs

Reputation: 2490

I just checked and found another way without restarting Xcode.

I have the same issue. @ravin001 i did the same thing as you and quit and restarted Xcode but i found another way.

• Go ahead and Right Click wherever you want to create the Folder/Group.
• Select New Group.
Press Enter to name the Folder/Group whatever Xcode suggested (usually "New Group").
• Now make sure the new Folder/Group is selected and Open the inspector panel.

Inspector Panel: top most right corner.

• The little page "file inspector" should be highlighted. If not, select it.

Trying to rename it won't work, First you have to rename the folder wherever it's stored.
- To do so:

• In the inspector panel, underneath the "location" title, you should see a folder icon. Click on that folder icon.
• Xcode will open a "choose a location" folder structure widget right in the middle of the screen.
Right Click on the "New Group" folder and Rename it to whatever you want.
Click on the 'Choose' button to close the widget ("It's important to select choose")

Now you rename the folder to whatever you like in Xcode

NOTE

• Renaming the folder any other way other than through the "Choose a location" way, won't work and you still won't be able to edit the folder

• You'll need to do this for every folder you create. So if you just created the project and will be adding a lot of folders, then it's probably best to restart xcode

Upvotes: 28

AlejandroJS
AlejandroJS

Reputation: 1045

In my case the folder was already created on the filesystem but it wasn't showing on the Project Navigator.

I only had to change the location of the "New Group" folder using the folder icon on File Inspector tab.

enter image description here

Upvotes: 1

Rahul Gusain
Rahul Gusain

Reputation: 275

i am also facing this issue. What works for me is Force Quit Xcode and restart it. Also make sure that your group should be in Right path by Right Clicking and show in Finder option.

Upvotes: 2

KinneyKare
KinneyKare

Reputation: 118

If you just created this group and you know for sure that the name wasn't already used in this project... Make sure the folder is not open.
You do this but looking to the left side of the folder(there is a triangle/arrow) if the triangle is pointing down, this means the folder is open and Xcode won't allow you to rename the folder.
Simply press the triangle to close it (it will be pointing towards the right when closed) and try to rename again.
You shouldn't have to exit out of Xcode!!!

See next to "New Group" the arrow is pointing down
see next to "New Group" the arrow is pointing down

Tap on the arrow and it will point to the right
tap on the arrow and it will point to the right

Now you are able to change the name to Controller
Now you are able to change the name to Controller

Let me know if this solved you issue.

Upvotes: 2

ApperleyA
ApperleyA

Reputation: 603

I was seeing this problem today. After further investigation I determined it was due to already having folders in that directory using the same names. This was caused by creating a Group in Xcode but reverting my git changes, which didn't revert the folder creation only the Xcode Project File changes.

Check in Finder that the folder/group names are unique.

Upvotes: 18

ravin001
ravin001

Reputation: 661

I was facing the same issue today. Only thing which helped me was quitting the Xcode and restarting it. It is working for me now

Upvotes: 48

Related Questions