I'm in Sublime working on a project that I need to add a folder in; when I right click to try "Add Folder.." I type in name, press enter and nothing happens. It will still allow me to add a file no problem, but that's not what I need just yet.
You can add files and folders on the sidebar in Sublime Text. First, go to Project -> Add Folder to Project and select whatever your parent folder is. That'll put your parent folder in the sidebar. Then you can right click on any of the folders in the sidebar to create child files and folders.
I was having the same problems, not being able to create folders in the sidebar. Luckily, this method worked for me:
I typed in the name field the full path of one random file:
foldername-1/foldername/filename.php
The folders got created automatically.
I thought I had the same issue, but I've realised that when you click on create New Folder, appears a bar at the bottom asking you for the Folder Name. Once you give it a name, the folder will be added.
I may have the same problem with you.
When I press Enter, it actually gives me a newline.
I can't apply the rename/add folder action through sidebar.
This github issue may be related.
Related
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?
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
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
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.
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
Tap on the arrow and it will point to the right
Now you are able to change the name to Controller
Let me know if this solved you issue.
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.
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.
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?
Open terminal and navigate to parent directory of desired directory : cd ~/../parent or just right click parent directory and choose New Terminal at Folder
Remove desired directory : rm -rf MyGroup
Now you can try to create your group with MyGroup name.
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.
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.
How do I rename a project in Xcode 5?
What steps do I need to take?
In the past this was always a very tricky manual process.
Well, the answer is very very very Apple simple in Xcode 5!
In the Project Navigator on the left side, click 2 x slowly and the Project file name will be editable.
Type the new name.
A sheet will appear with a warning and will list all the items Xcode 5 believes it should change.
You can probably trust it, but you should inspect it.
The list will include the info.plist and various files, but also all the relevant strings from nib/xib files like MainMenu menus.
Accept the changes and you will get the prompt to save a snapshot of the project.
Always make a snapshot when Xcode asks, it will be useful to restore if something does not work.
Change the project name:-
Click on the target in xcode, on the right in "Identify and Type" under name change the name and press the ENTER button on your keyboard.
A window will appear confirming the change and what it will change. Once you confirm it will make the changes.
Change the root folder name:-
Go to the project directory and rename the root folder,
Open the project and u will find all the file are missing, u need to add all the files of project again
Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor.
4>Search and replace any occurrence of the original folder name with the new folder name.
5>Save the file.
Change the Scheme name:-
rename .xscheme file
If your Project is static framework then make sure your header file has public target membership
I really recommend just opening the folder in a general editor such as Sublime Text, and doing a find/replace across the whole folder. The other methods I found were unstable, particularly when combined with .xcworkspace and cocoapods.
In Xcode 8.0, to rename your project, just go through the following instructions as described in Xcode help:
1- Select your project in the project navigator.
2- In the Identity and Type section of the File inspector, enter a new
name into the Name field.
3- Press Return.
A dialog is displayed, listing the items in your project that can be
renamed. The dialog includes a preview of how the items will appear
after the change.
4- To selectively rename items, disable the checkboxes for any items
you don’t want to rename. To rename only your app, leave the app
selected and deselect all other items.
5- Click Rename.
Source: http://help.apple.com/xcode/mac/8.0/#/dev3db3afe4f
Xcode 6 (beta 6 as of now) seems to be not very reliable with renaming projects. For me it didn't rename several of the files and groups. It also doesn't rename the physical folder the project is in. To rename my project to be sure that everything is clean I went the extra length to create a new project with the new name and copy over all the files. The assets are easy to copy but groups have to be recreated. The biggest issue with this however are CoreData data model files. Trying to simply copy this will result in a corrupt model file, even though everything looks like it is alright.
When you re-name the project name in XCode5 then info.plist entry removed from Targets --- > General ---> identity. You just need to mention it again.
In Xcode 7, renaming a project can still break your app. Make sure you backed it up before trying it.
Click on the project icon and find the project name in the inspector pane. If you change it there, Xcode will ask you if you want to rename related files. Might work. But if not, try this brute force approach:
Close Xcode
Using an advanced text editor like Sublime Text or Atom, open the
root folder. It will open the folder structure.
Perform a Global Search and Replace (it's probably cmd + shift + f), and
replace My Wrong App Name with New App. If your project name contained spaces, also search for My_Wrong_App_Name and replace
with
New_App. This changes all file contents.
Now you need to find all
the files inside the project with your old app name. Rename them
all, also the folders.
Important: Open the project file with
right click > Show Package Contents, and rename all files in there.
Reopen your Xcode project or workspace. Compile.
If you use Pods, you need to open the pods project as well and change the files in there.
Here is another great example which works well with xcode 5
OK so if i want to create a new project i drag and drop a folder onto the sidebar, after which the contents show up in the sidebar.
My question is, is there any way to hide the root folder (as indicated)?
To clarify, I dont want to have to go inside the 'Wordpress' folder and add the substructure manually to create a project (ctrl+a , drag drop). I just want to be able to drag and drop the root directory (Wordpress in this case) and have it add all subfolders / files without it showing the root Wordpress Folder.
I just find it annoying for example, if i wanted to get into wp-admin the possibility of misclicking and collapsing the entire directory.
No, there is no way to do this. The base folder is the base folder, and is the container which holds all its files and subfolders. If you remove it, you have no way of identifying where the contents are located. If you want quick access to one of the subfolders, just add it to your project.
Additionally, with the latest releases of ST3, mis-clicking the wrong folder is no longer an issue, as Sublime remembers all the open subfolders, and the entire chain will be restored just like it was if you clicked again.
How do I rename a project in Xcode 5?
What steps do I need to take?
In the past this was always a very tricky manual process.
Well, the answer is very very very Apple simple in Xcode 5!
In the Project Navigator on the left side, click 2 x slowly and the Project file name will be editable.
Type the new name.
A sheet will appear with a warning and will list all the items Xcode 5 believes it should change.
You can probably trust it, but you should inspect it.
The list will include the info.plist and various files, but also all the relevant strings from nib/xib files like MainMenu menus.
Accept the changes and you will get the prompt to save a snapshot of the project.
Always make a snapshot when Xcode asks, it will be useful to restore if something does not work.
Change the project name:-
Click on the target in xcode, on the right in "Identify and Type" under name change the name and press the ENTER button on your keyboard.
A window will appear confirming the change and what it will change. Once you confirm it will make the changes.
Change the root folder name:-
Go to the project directory and rename the root folder,
Open the project and u will find all the file are missing, u need to add all the files of project again
Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor.
4>Search and replace any occurrence of the original folder name with the new folder name.
5>Save the file.
Change the Scheme name:-
rename .xscheme file
If your Project is static framework then make sure your header file has public target membership
I really recommend just opening the folder in a general editor such as Sublime Text, and doing a find/replace across the whole folder. The other methods I found were unstable, particularly when combined with .xcworkspace and cocoapods.
In Xcode 8.0, to rename your project, just go through the following instructions as described in Xcode help:
1- Select your project in the project navigator.
2- In the Identity and Type section of the File inspector, enter a new
name into the Name field.
3- Press Return.
A dialog is displayed, listing the items in your project that can be
renamed. The dialog includes a preview of how the items will appear
after the change.
4- To selectively rename items, disable the checkboxes for any items
you don’t want to rename. To rename only your app, leave the app
selected and deselect all other items.
5- Click Rename.
Source: http://help.apple.com/xcode/mac/8.0/#/dev3db3afe4f
Xcode 6 (beta 6 as of now) seems to be not very reliable with renaming projects. For me it didn't rename several of the files and groups. It also doesn't rename the physical folder the project is in. To rename my project to be sure that everything is clean I went the extra length to create a new project with the new name and copy over all the files. The assets are easy to copy but groups have to be recreated. The biggest issue with this however are CoreData data model files. Trying to simply copy this will result in a corrupt model file, even though everything looks like it is alright.
When you re-name the project name in XCode5 then info.plist entry removed from Targets --- > General ---> identity. You just need to mention it again.
In Xcode 7, renaming a project can still break your app. Make sure you backed it up before trying it.
Click on the project icon and find the project name in the inspector pane. If you change it there, Xcode will ask you if you want to rename related files. Might work. But if not, try this brute force approach:
Close Xcode
Using an advanced text editor like Sublime Text or Atom, open the
root folder. It will open the folder structure.
Perform a Global Search and Replace (it's probably cmd + shift + f), and
replace My Wrong App Name with New App. If your project name contained spaces, also search for My_Wrong_App_Name and replace
with
New_App. This changes all file contents.
Now you need to find all
the files inside the project with your old app name. Rename them
all, also the folders.
Important: Open the project file with
right click > Show Package Contents, and rename all files in there.
Reopen your Xcode project or workspace. Compile.
If you use Pods, you need to open the pods project as well and change the files in there.
Here is another great example which works well with xcode 5
After I create a project name for example Proj11, I'd like to change the name to Proj12.
So I use Project->Rename, then the name of the project to Proj12
But the project still contains several folders name Prlj11, and after I change the folders' name, the project can't been loaded.
So what is the standard way to rename my project as well as folder name.
Click on the project folder (blue folder with your app name on the top of the project navigator). Pull up the utilities (right pane), then file inspector. Your project name is there, change it to whatever you want. Then it will ask to save, keep all the files it selected for you selected, then press rename
The best answer I found was on the apple developer site. Imagine that? You can follow the link below, but essentially it is:
1) click on the target in xcode, on the right in "Identify and Type" under name change the name and press the ENTER button on your keyboard.
2)a window will appear confirming the change and what it will change. Once you confirm it will make the changes.
https://developer.apple.com/library/ios/qa/qa1625/_index.html
OR ANOTHER WAY AND EVEN EASIER:
left-click on the name project and rename. As soon as you rename it will ask you if you want to rename:
The folders you see in XCode navigators are not an actual folder/directories, these are virtual folders only to group your files.
And the folders you see in Finder, the path you manually set for the project, you need to rename them manually.