Skip to content →

Tag: xcode

Xcode 7 crashing when toggling Assistant editor

I had a Xcode project which was crashing whenever I tried to close the Assistant editor.  Here is what I did to fix it.

  1. Close the project in XCode
  2. Delete the following files using the Terminal.  Where “myproject” is the name your project.


rm -rf myproject.xcworkspace/xcuserdata

rm -rf myproject.xcodeproj/xcuserdata

rm -rf myproject.xcodeproj/project.xcworkspace

If you don’t feel comfortable using the Terminal, you can also right click on the file and choose “Show Package Contents” and delete the files.

If you don’t use CocoaPods, you may not have a myproject.xcworkspace

This solution may fix other Xcode crashing issues.

Comments closed

ld: library not found for -lPods

I’ve had this error a few times, so I figured I’d document the solution for the next time it occurred.

When doing a build in Xcode, I got the following error:


ld: library not found for -lPods

My project is setup to use cocoapods.

First make sure you are using MyProject.xcworkspace and not MyProject.xcodeproj

For me this was the case.  But I realized that I just created a new configuration for “Ad Hoc” builds.  To fix the problem I had to install the Podfile again with the command:


pod install

After running pod infall, open the project: MyProject.xcworkspace, clean your project and build.  The error should go away.

Comments closed

How To Rename an iPhone XCode Project

I recent created a new iPhone XCode project based off of one of the samples provided by Apple. Beause of this the XCode project was called AppleSample.xcodeproj and it built an app called AppleSample.app. I wanted to rename the project and give it my own name. It’s not as easy as it sounds. Here are some instructions which are based off some instructions I found here (http://aplus.rs/cocoa/how-to-rename-project-in-xcode-3x/)

  • Copy/rename the folder into new name
  • Get inside the new folder and rename the .pch and .xcodeproj files. Example rename AppleSample.xcodeproj to MyCoolApp.xcodeproj — and — rename AppleSamplePrefix.pch to MyCoolApp_Prefix.pch
  • Delete the build folder. (Using the finder)
  • Open .xcodeproj file in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click and do Show package contents, which will reveal the files)
  • Open project.pbxproj in text editor and replace all instances of the old name with the new name. Be careful not to do a find an replace. Since the default name was AppleSample, there were several references to: AppleSampleAppDelegate.h and AppleSampleAppDelegate.m. You do not want to replace these unless you also rename that file.
  • Open .pbxuser where is your user name. Then repeat the previous step by renaming. I’m not sure if this is necessary. You may even be able to delete this file? But changing this file worked for me.
  • Load the project file in XCode, do Build/Clean all targets

After following these steps, I was able to open the project and build it to the simulator and the device.

I had one additional problem that I came across later that required a fix. When I finially built the application for “deployment” to the App Store, I had problems signing the code. I complained that it couldn’t find the Certificate for “Scott Anguish”. I looked in the build settings and couldn’t find reference to this name. So again I opened project.pbxproj inside of MyCoolApp.xcodeproj and found 2 instances of this line:

CODE_SIGN_IDENTITY = “Scott Anguish”;

I replaced both of them with the correct code signing identity and it worked!

UPDATE: Check out this bash script which does it for you automatically:
renameXcodeProject.sh

Comments closed