I am working on an iphone app and i created different group folders like Json ,Asi etc .
In Xcode its easy to classify the file in this way , but when i am trying to show in finder all the files are comes under the main project .
Is there any way to make grouped folder visible and also to show in finder?
I tried to create folders manually but it is also not working .
Thanks in advance.
No. You have to track (create) the folders both in xocde and in finder manually.
You can create folder in finder and then can import that folder in xcode.
The folder you make in xcode is identical to the finder.
So, the folder that you will make in finder, will be the original tree structure for your project.
you have to physically create your folders first in order to find that folder in finder. do following steps :
Go to Project Folder.
Create new folder.
Go to opened project in xcode. Right click on project folder visible in left panel.
Add Files to "your project Name".
Select your folder and uncheck copy items to destination'folder
Done.
Thanks,
If you create a folder or group in X-Code it does not actually create physical folder in the file system of your MAC instead it manages a group with in the x-code project file with files you added to that group.In other words as mentioned in the above answers you need to create the physical folder in projects root directory and add to x-code to get the behavior you are looking for.
Related
I have an iphone project that is a "base" project. I want to copy this project, rename it and change a couple of files so as to create the final version of each application I want. How can I copy and rename a project in xcode 4.3+ without having any issues (like lost targets or so) ?
Click on your Project,
enter name of your project and prees enter,
it will ask,
Rename Project Content Items ?
say Rename then it will ask you for snapshot, click on Enable
and then press OK
Done !
You could also just create a new project and import only the header and code files you need.
In my xcode project i have created a folder manually named "MyClasses" to place the newly added files/classes to this folder.
Now i have nearly 30 classes in this folder.
when i renamed this folder , all the files in this folder are gets Erased.
Now i need to rename the folder to "ViewControllerClasses".
But i lost 30 .h, .m, xib files. [lucky i have a copy & and zip file]
How to rename the folder with out corrupting the files.
Renamed it to myviewcontrollerclasswes
When i renamed
Two Solutions
Method_1. Try Manual editing:
« Drag your MedChart.xcodeproj to TextWrangler (or any text editor)
« Use find button to find "FolderName" (Your folder name)
« Replace all with new name.
« In some project you may notice header search path problem...goto header search path and replace with new name.
Method_2. Use Xcode to choose base folder:
Rename folder in finder then use Xcode to choose same folder.
NOTE as of 2017:
Now Xcode 9 synchronises the folder and the project hierarchy automatically.
NOTE as of 2013:
Duplicate and rename Xcode project & associated folders
The "folders" what you see in XCode under your project file are not real folders in the file system, only virtual folders administered in the .xcodeproj file. You can organize your files in the project folder independently from their location in the file system. Some prefers to map the file system folder structure inside the project folder structure, some others store all source files in one big folder in the file system and organize them only in the project folders: it's rather a question of preference.
However if you rename/move physically the files in the file system, you will have to delete and re-add them to your project since XCode will not know where to find them. Pay attention not to delete them physically only remove them from XCode project, then re-add them and reorganize as you want.
One more thing to note: if you are using version control system you will have to inform also its client (svn or git most likely) that you have renamed/moved your files. If you want to keep file revision history it will be a good idea to issue the copy/move command explicitly to the version control otherwise it will treat your files as deleted from the old location and added as new in the new location.
In case anyone is still having trouble with this:
Select the folder or file in the left-side bar of XCode corresponding to the folder you want to rename (for me I renamed the folder containing all my files so I selected the topmost folder)
On the right-side bar, below where it says 'Location', click the folder icon.
In the file explorer that opens up rename the existing folder to whatever name you'd like it to be, then afterwards select it and press 'Ok'.
XCode should update the file locations accordingly.
Keep in mind that if you rename something which contains a file that is hard-coded as a certain path in your build settings, XCode will throw an error. You'll have to manually change those paths in your build settings.
This worked for me, hope it works for you too.
You should just run a search and replace on the project file (if you are working with version control and with other developers you will have seen this file a lot without a doubt), it's the project.pbxproj file located inside the xxxxxxxx.xcodeproj file.
Just right click (Control + Click) on the file and select "Show Package Contents" to find the xcodeproj file.
I still find it easier than all these methods to simply create a new folder in your file navigator and then drag your files from the other folder into it. Sometimes the simplest way is the best way. It literally takes me 10 seconds and I don't need to leave Xcode.
I need to create a folder for some images, I'm doing it right now using "New Group", inside the Project Navigator of my Xcode Project.
The problem comes when I see the contents of the .app package, and inside it the images are with all the other files (not inside my folder)
How can I create a folder that will be inside of the .app?
1. Create a folder with the images.
2. While adding into the Xcode you drag and drop the folder and choose the option "Create folder references for any added folders".
The folder will be in blue color, not yellow.
Create a folder in you project folder, add image to that folder and then add them to Xcode.
If I create a group of images as resource files in xcode4 right menu, How can I :
-automaticly create this group name as sub-directory in resource path, with all the files in it?
-get all the names of files in that folder ?
thanks.
I don't think Xcode can do these things.
In addition, Xcode doesn't suggest to make a lot of folders in your project folder. The default folders created by template is good enough. You do NOT need to manager them by yourself.
But if you insist on managing folders in your project by yourself, you should do it with Finder and then add them to Xcode as References (Make sure "Create groups for any added folders" is selected).
When I create a new project in Xcode 4 it does not create the resources folder like Xcode 3 used to do. Is there a setting in Xcode 4 to make this work?
As badcat indicates in his comments, the Resources folder was merely a group within the project template. To create your own Resources group, either right-click on the project explorer view and choose New Group, or go to the menu option File | New | New Group.
If you want to make sure that items which should be resources are copied into the correct location in your application bundle, you can click on the name of your project in the project explorer on the left of the screen and go to the Build Phases tab. You can expand the Copy Bundle Resources build phase (or whatever it's called in your project) and see the files that will be copied over. If something is missing, you can drag it into that list from the project explorer.
Not sure what you mean by "Resources" folder, but maybe this answer helps you with that:
Where is build output going?
Check out this question if you don't just want the group but also the physical folder on your filesystem: How do I get the resources folder back in Xcode 4?