Skip to content

Instantly share code, notes, and snippets.

@wooster
Created November 11, 2011 22:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wooster/1359532 to your computer and use it in GitHub Desktop.
Save wooster/1359532 to your computer and use it in GitHub Desktop.
Miscellaneous iOS Notes

Debugging

No Exception Backtraces in iOS 5

There's a bug in the iOS 5 SDK where symbols aren't showing up in the debugger for exception backtraces.

To work around it, go into the breakpoint navigator in Xcode 4, then down at the bottom left, click on the + button and choose "Add Exception Breakpoint…". Set it to break "On Throw", and you should get a breakpoint where the exception is thrown.

Entitlements

Invalid Entitlements

Per TN2250:

As of Xcode 4, you are no longer required to create a custom code signing entitlements file for Ad Hoc builds; previously, you had to set 'get-task-allow' or 'Can be debugged' to false (unchecked), however Xcode 4 now does this for you. Therefore, the only two reasons to specify a custom code signing entitlements file is for iCloud, or custom Keychain Access Sharing.

ARC Notes

Empty Previews When Converting Project

If you get an empty preview when refactoring an ARC project, try this tip from the devforums (which worked for me):

  1. File > Project Settings…
  2. Make sure Derived Data Location is "Default"
  3. Click Advanced…
  4. Change Build Location to "Derived Data Location"
  5. Make sure "Default subfolder" is selected

There's also a note in the iOS 5.0 release notes about a similar problem:

In Xcode, if the configuration is set to Device and there is a space in the path of one of the source files (more commonly, the project is inside a directory with spaces), the “Convert to Automatic Reference Counting” step (after Precheck) will fail with error: Error in format of file: . If encountered, the user should switch to Simulator and retry the migration.

Save Button Beeps on Migration

Posters on devforums claim this can be solved by temporarily moving your .git subfolder aside before converting, then moving it back.

Build Automation

xcodebuild clean Doesn't Work Anymore

xcodebuild clean used to work. Now it doesn't, because intermediate products are cached in ~/Library/Developer/Xcode/DerivedData/ProjectName-*. These intermediate products are used for the next build, regardless of whether a clean action was performed or not. This can leave image files and other resources around, causing incorrect builds.

If you really need to clean a project (as, for example, in a build script), removing the DerivedData/ProjectName-* directories corresponding to your project seems to work.

I've logged this as rdar://10453382.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment