Web Apps Since 2004.

Is your website boring?  Kick it up a notch.  Encodable apps easily drop into your website to make it modern, fun, and interactive, with features like file uploads, user accounts, paid subscriptions, protected pages, live chat, visitor logging, mailing lists, and more.
All apps include:
• Money-back guarantee
• No monthly fees
• Free tech support
• Easy setup (we can even do it for you!)

How To Rename An Xcode Project

# Filed on May 16, 2009 by AnthonyDiSante 5 replies

When you’re using Xcode to develop an iPhone app or a Mac app, you might decide that you need to rename your project.  In many cases this would mean not only renaming the actual executable file that gets produced, but also the names of various source code files, project folders, and the contents of various files within the project.

As far as I can tell, Xcode provides no way to do this.  There are a few settings that seem like they might do part of it, but every time I tried to use one of them within Xcode, it just resulted in errors and my project failing to build.  After many hours and much frustration with Xcode, I decided to try it the Unix way, and it worked.  The solution is a straightforward 3-step process:

1. First I closed Xcode, and made a backup of my project folder.  Then I went into my project folder and renamed every file and folder which contained "OldName" so that it now contained "NewName" instead.  This could be scripted pretty easily but my current project is a small one so I spent the ~5 minutes to manually rename the files and folders.

2. In the project folder, I ran the following command in a terminal, to update the contents of the files in the project:

find . -type f -exec sed -i 's/OldName/NewName/g' "{}" \;

3. I opened the now-renamed project in Xcode and clicked Build -> Clean All Targets.

After that, the project (with the new name) built successfully.

Comments:

01. Jan 6, 2010 at 09:49pm by PaulMasson:

Brilliant! Works like a charm with one modification: for Mac OS X Leopard, you must specify an empty extension with the -i switch, or the stream editor will return an "invalid command code" message.

02. Apr 2, 2010 at 12:59am by MikeTheCat:

OK, that sounds nice, but those of us who are new to the Mac/OSX don’t know the command syntax to "specify an empty extension" with the -i switch.  I’ve also seen some reference to need for the -e switch when using -i, but that might not apply here.

Can you show the modified command to include the "empty extension"?

03. Apr 2, 2010 at 02:54am by MikeTheCat:

Other info, such as on forums macosxhints com, suggest that all of these should work in Leopard.

find . -type f -exec sed -i "" ’s/OldName/NewName/g’ "{}" \;

find . -type f -exec sed -i "" -e ’s/OldName/NewName/g’ "{}" \;

find . -type f -exec sed -i -e ’s/OldName/NewName/g’ "{}" \;

find . -type f -exec sed -ie ’s/OldName/NewName/g’ "{}" \;

Can anybody confirm if which of those, if any, will work?

04. Apr 2, 2010 at 07:43am by AnthonyDiSante:

If you run the command "man sed" you’ll see the sed manual, which explains how the -i switch works.  Here’s a quote:

-i extension: Edit files in-place, saving backups with the specified extension.  If a zero-length extension is given, no backup will be saved.

So just plain -i, or -i followed by empty quotes, will probably both work the same; either way should be fine.

05. Apr 2, 2010 at 02:13pm by MikeTheCat:

The post from Jan 6 suggested that the -i by itself doesn’t work in Leopard without the "" to specify the empty extension, but thanks for the additional lead to the full information.  This will help me form the habit of using that tool.

Reply to this message here:

Your name
Email (why?)
Website (if you have one)
Subject
search posts:

home | archives ]

Shopping Cart

Your cart is empty.

Client Quotes

FileChucker is working great...  Clients love it.  Vendors love it.  We love it.
– Gerry W.
I just installed the demo of your product and got it up and running in no time.  I searched high and low for a decent login script and thank God I found yours.
– Adrian F.
FileChucker is a great drop-in solution for file uploads, and worth every penny of its very reasonable cost.  Encodable's support is excellent to boot.
– Loren A.
Why didn't I just do this from the get-go?  So much easier.  Thanks for your work.  FileChucker makes my work easier.
– Dominic M.
I looked all over trying to find a simple cgi script.  I found that FileChucker was by far the best.  If you have issues with your hosting service's php.ini max upload size then this is the way to go.  Looking forward to future enhancements.
– Bob C.
I just wanted to say that yours is the first product that I've tested so far that hasn't failed on handling uploads.  This is going to work for a print company, so they are handling nothing but large files and all the other solutions I've tried so far have not been reliable.  So far yours has been 100% successful in my tests.
– Kevin H.
Thanks again for a great product and great support - beyond expectations.
– Greg S.
Just one word: Fantastic.  10-minute job to plug FileChucker into my app, and it now works a treat.  It's through the hard work by people like yourselves that make my job so much easier.  Congratulations on an outstanding product... Many many thanks.
– Sean F.
The work, the thought and the organization you put into this app is incredible.
– Bruce C.
FileChucker is helping drive the backend of several high profile entertainment sites for people like Shania Twain and Dolly Parton.  We're also using it to drive backend file uploads for a multi-billion dollar banking institution.  It's a great product.  We've tried other "chucking" upload solutions with progress bars using flash and php, but nothing works as reliably as FileChucker.
– Michael W.
I just want to say you guys really stand alone in that you have a quality product and you provide genuine customer service.  It's sad but those qualities are seldom found separately, much less together.  Thanks again for your time and help.
– Alex S.
Do you know how rare it is to have a "canned" shopping cart that can easily do complex pricing options on a single item?  Basically, they don't exist!  I have looked.  Everywhere!  And the few that might even come close to CornerStore's functionality cost a fortune!
– Tashina P.
Our members think your software is fantastic...  I would recommend your software and your company to anyone.  Thanks for all your help.  It has been a pleasure dealing with you.
– Tommy A.
You've done a wonderful job with FileChucker and UserBase, and they have made a big difference to how our website runs.
– Nicholas H.
The amount of customization in the program is incredible.  I was able to integrate it into my existing page layout relatively simply.  I was also able to easily customize the look/feel to match the current site.
– Jason M.
Thank you VERY much for all of your help.  You've really impressed me.  We have support agreements for other software that costs thousands of dollars / year (just for the support), and most of them aren't as helpful as you have been.
– Keith Y.
Nice script, it's saving the day on our project.
– Aaron W.