How to rename an iPhone project in Xcode4? - iphone

I am developing an iPhone application using XCode4 editor. I have to rename my project. I can't create a new project with new name because I have proceeded too far with my coding and there are too many files in the project.
How can I rename my project in Xcode4? I have searched on net but cant find such options in xcode4 to rename the project.

You can click on project name in xcode and then click again. The field becomes editable. Rename it and it will prompt you to rename the other files and delegate class names.
Its really simple in xcode 4. Renaming files, folders, groups and project names can be done using the above method.

You can set bundle display name in info.plist. it shows your name with icon. and for renaming the folder name simply select the folder and single click on the name then you can change the name.
When you rename your folder name, you can also change your app delegate class name and product name in info where you give provisioning profile for installing on device.

Related

Can I re-open .xcarchive on Xcode?

Is it possible to re-open an .xcarchive file on Xcode?
I know this is not common, but I would like to open a project exactly as it was submitted to the App Store. I don't have back up of that exact build, so it would be really great to open the archive copy!
Before you ask why don't I just download it from the store, I must say this build has been approved and is just pending on my release. :)
Thanks!
A xcarchive is a folder containing a (compiled) app bundle, a dSYM (debug file) for the app, and an Info.plist containing metadata about the archive (such as the name of the app and the date the archive was created). You can look inside a `xcarchive by control-clicking or right-clicking it in the Finder and choosing “Show Package Contents”.
The archive does not contain your app's source code (unless you have made a serious mistake in your project configuration).
You should use a version tracking system like git to store your source code. When you create an xcarchive for distribution, you should tag the current version of the source code in your build system, so that you can easily extract the source code used to build that archive.
You can see contents of ProjectName [Date Time].xcarchive by right click on it and select Show Package Content.
It comprises of three things :
dSYMs : dSYM files store the debug symbols for your app.
Info.plist : property list containing details such as ApplicationProperties, ArchiveVersion, CreationDate, Name, Scheme.
Products : This contains App file for your project.

Xcode - How to change application/project name : what do I need to to update and check?

Using Xcode 4.2, if I want to change my application/project name (including the name of the project folder and subfolder that are auto created by Xcode), what are the different items I need to update to make the whole thing compile and work again like a charm ?
I have noticed that I have to change the pch acces path, the bundle identifier, ... but I'm afraid of missing something.
It's really easy in Xcode 4. Simply double click (slowly) on your project name in the Navigator (the bar on the left). When you change the name of your project, Xcode will ask you to confirm which files to change (generally, it will be all of the ones necessary).
Alternately, if you simply want to change the name of your bundle (the name of your app as it appears in a users' home screen), you can just change your "Bundle Display Name" in your app plist.
An advice : NEVER change the name of your project without having saved the whole thing before. Even if XCode has a feature that helps to do this, using it may destroy all your hard work to organise your project, letting many many dirty things everywhere, not changing everything that needs to be changed, it's just awfull. I've tried this some days ago on a just simple project, letting XCode change the main things, but it has let so many things unchanged, or changed things without updating links, so I've had to rebuild a new project from the beginning to make it compile again.
If you just want to change the App name, select the project in xcode, select the app in TARGETS > YourAppOldName. Press enter, rename the OldName. Save, compile. thats all!
Change the config.xml from the main www directory
Here is the Name you want to change
here is description of your application
My team
Now rebuild app with CLI
phonegap build ios, phonegap install ios or phonegap run ios

groups and files in XCode vs. project folders in Finder

I still can't get the idea that when I create a new Group in XCode, and build the project, and then return back to finder and notice that the group does not exist but any file to be created under this group will appear in the project's directory in finder but that file is alone without being under any group.
(note: I'm not talking about this directory: /Users/username/Library/Application Support/iPhone Simulator/4.3/Applications/uuid/...)
1) can anyone explain why project's directory hierarchy in finder is different from the project's directory hierarchy in XCode ?
2) how can I make the two hierarchies looks like exactly the same between XCode and Finder? so when I create a new Group in future I can see it in finder.
thanks in advance.
Currently you cannot see the group you create in Xcode in finder. Its just a logical entity for you to organise your projects in a better way. Assuming you will be using xcode to make all the changes (including version control) you can use that categorisation and make sense out of it in Xcode.
However you always have the option of creating a folder in finder(your project workspace) and create files and save them in that folder using Xcode. This is particularly helpful for viewing organized code while browsing through the file system. Also you can group files into folders which you can then use across projects.
So basically it boils down to what your use case is. As for me i am happy using xcode. I usually create a directory to hold images and copy directories for libraries into my project folder so that there is clean organisation in the file system too.
Another helpful method is after you create the group in Xcode, but before you put files in it, check the File Inspector pane on the right with the group selected. Make sure Location is set Relative to Group and then click on the folder icon below that. This will bring up a Finder window. Then, make a directory with the same name, and click Choose. Now, anything you put in that group will go in that folder of the same name.
Simple solution is that you make the require folder in Finder, then go to Xcode. In navigator, right click and select "Add files to" option, add the that folder. It will be added to your navigator as well. Now whatever you add to that group, it will be automatically added to your folder in finder as well.

Duplicating an Xcode 4 Project

Basically I want to make an independent copy of my Xcode project and all of my files. How can I do this? I'm researching graphing frameworks and I want to use the same UI for each.
Seconding #zoul's comment, this can be accomplished in Xcode 4.5 with four steps.
In Finder, duplicate the project folder. Do not update the .xcodeproj file name.
In Xcode, rename the project. Accept the proposed changes.
Still in Xcode, rename the scheme in "Manage Schemes".
In Info.plist, rename your Bundle identifier.
Few months ago, I had the need to create a different applications with the same source code.
I didn't wanted to copy the full directory, so I came up with a procedure that allowed me to mantain the source code in one place and create many different apps based on the same source code.
My procedure is the following:
duplicate the target to make a new target and change the name to the new name
change the name of the product and info.plist in the build options (select the new target and click info button), make sure this is for All Configurations
rename the info.plist file created at the duplication to "newnameInfo".plist (click on the file and then info button and pick the target)
add icon.png to the resources for the specific target.
change the name of the icon
in the NewnameInfo.plist change the icon name to icon_xxx and the bundle identifier com.yourdomain.newname
in language/other flags you can have a flag to check at the code.
create a new APP_ID in the iOS Provisional Portal
if APN is used, configure the APN BEFORE creating the development profile
create a new development & distribution (ad-hoc or appstore)
in Target (info) choose the right profile for the code sign
I hope this helps.
--nnahum
Go to your project folder. Right click on it. Select "duplicate".
Is there something you want to achieve that this doesn't accomplish?
Copy and paste your project folder. Open the new folder and open the Xcode project file. Select the project name in the "Project Navigator" on the left side and then in "File Inspector" on the right hand side, change the name of the project under Identity and Type.
That way you will have a duplicate project with two different names.
Hope this helps!

Renamed Files Still Exist in Xcode

I'm making an iphone app that displays a random picture chosen from pictures in Resources.
I have renamed some files for categorization,
but running console shows that file with a new name and file with old name both exist as separate files.
Of course, I can't see the file with the old name in my Resource folder, nor in the original folder where the pictures are.
Kinda freaky...
How could I remove the files with old names and make it a norm to not keep another file with the old name whenever I rename a file?
Please help me out.
Thanx.
Expand your Target and remove the images from Copy Bundle Resources.
I'm not sure I understand your question correctly, but I recommend cleaning your targets from the project menu and resetting the simulator.
You can also select all the new files in XCode, right click and select compile.