O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Troubleshooting Xcode

Book Description

Troubleshooting Xcode is a handbook for software developers of all levels creating applications for iOS and OS X using both Objective-C and Swift.

If you’ve struggled in the past to make Xcode work as expected, to solve problems that defy logic, and to understand Xcode’s misleading or cryptic error messages and unexpected crashes, Troubleshooting Xcode is for you.

Troubleshooting Xcode is great for the developer wanting to extend his or her knowledge about obscure problems and limitations involving the use of Xcode, Objective-C, and Swift as well as how to use automation to increase productivity and make some repetitive tasks easier.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Contents at a Glance
  5. Contents
  6. About the Author
  7. About the Technical Reviewer
  8. Preface
  9. Troubleshooting Xcode
    1. Fighting Back
    2. Xcode Crashing when Opening a Project File?
      1. If you are not using CocoaPods
      2. If you are using CocoaPods
    3. The Identity Used to Sign the Executable Is Invalid
    4. Xcode Fails to Compile and Blames “SBPartialInfo”
      1. Problem with a NSLayoutConstraint
      2. Incorrect path to Info.plist
      3. Info.plist must NOT be assigned to a target
      4. Duplicate references to the storyboard file
    5. No Matching Provisioning Profiles Found
      1. Missing provisioning profile
    6. Compressing Images Better Than Photoshop
    7. Creating Packages for in-App Purchases
      1. Delivering content
      2. What is a package?
      3. Creating a package, the faster way
      4. Creating the final package
    8. Reduce Up to 75% of the Compiling Time
    9. Impossible “Constants” in Objective-C
      1. Constants.h
      2. Constants.m
    10. Concurrency with Core Data
      1. The code
    11. Creating Icons from Terminal
    12. Creating Icons for iOS Applications
    13. UINavigationBar Tint Not Working
      1. Swift
      2. Objective-C
    14. Debugging an Insanely Hard Quartz Error
      1. There is hope...
    15. Adding Objects to an Array Concurrently
      1. Objective-C
      2. Old-School C
      3. Back to the future
    16. The App Is Damaged and Can’t Be Opened
      1. The Condition
      2. The Gods want to punish you
    17. Application Failing to Obtain a Receipt
    18. Classes with the Same Name on Different Targets
      1. This is what you expect...
      2. Not so fast!
    19. A Case Against Base Internationalization
      1. Localization of interface elements
      2. Localization of UIBarButtonItem and other elements failing
    20. Checking for Missing Localizable.strings
    21. You Are Declaring Your NSString Wrong
      1. Objective-C
    22. CocoaPods: /Manifest.lock: No Such File or Directory
    23. Asset Catalogs Bug
      1. The bug
      2. The solution
    24. App Crashing Without Giving You Clues?
      1. Objective-C
    25. NSUserDefaults Not Working for a Sandboxed App?
    26. Interface Elements Not Updating?
      1. Swift
      2. Objective-C
    27. Find and Replace Strings Using Regex
      1. Swift
      2. Objective-C
      3. Swift
      4. Objective-C
      5. Using regular expressions
    28. Extracting a Dictionary from Array
      1. Swift: NSArray
      2. A Swift variation...
      3. Objective-C
    29. Magical Way for Counting Elements in Arrays
      1. Swift
      2. Objective-C
      3. Swift: NSArray
      4. A Swift variation...
      5. Objective-C
    30. OS X App Not Launching with the Correct Size
    31. Detecting the Application Target Running
      1. Swift
      2. Objective-C
    32. Disabling a Method on a Class
      1. Swift
      2. Objective-C
    33. Deprecating a Method on a Class
      1. Swift
      2. Objective-C
    34. Xcode “Beachballing” on You
    35. UIButton Not Grayed-Out
      1. Swift
      2. Objective-C
      3. Swift
      4. Objective-C
    36. Catching Memory Corruption
      1. The Sanitizer
    37. SpriteKit Crashing on didBeginContact
      1. Swift
      2. Objective-C
    38. SpriteKit Object Is Not Respecting Boundaries?
    39. A Case Against Using Storyboards for Cocoa Apps
      1. Swift
      2. Objective-C
    40. UIView Classes with Independent Rounded Corners
      1. Swift
      2. Objective-C
    41. Making NSViews “Compatible” with UIViews
      1. Swift
      2. Objective-C
    42. Detect when the UIPickerView Stops Spinning
      1. Swift
      2. Objective-C
    43. “Insane” NSDates
      1. Swift
      2. Objective-C
      3. Swift
      4. Objective-C
    44. Localizing the Application Name
    45. Centering Views Horizontally with Auto Layout
      1. Example
      2. Oops... bad idea
      3. What?!
      4. Logic just left the room
      5. This is how you defeat the beast
    46. Elements Grayed-Out on Storyboard After Copying
    47. Debugging Core Data
      1. Alone in the dark
    48. The package does not contain an Info.plist
    49. Check the Version of an App in the App Store
      1. Swift
      2. Objective-C
    50. Breakpoints and NSLog Not Working
      1. Project corruption
      2. Bad product scheme
    51. Slow Transitions Between ViewControllers
      1. Swift
      2. Objective-C
    52. Finished Running Problem
      1. We have warned you about the punishments
    53. Handoff Between iOS and Mac Clogged
      1. On your iOS device
      2. On your Mac
      3. On Mac OS X
      4. On your project
    54. Stubborn App’s Ubiquitous Container
      1. Verify this
      2. Here comes the secret “spell”...
      3. Where you can see the files...
      4. Swift
      5. Objective-C
    55. Power Tips
      1. CocoaPods
      2. GitHub
      3. StackOverflow
      4. fastlane Tools
      5. HandBrake
      6. Alcatraz
    56. Appendix
  10. Index