Xcode Version 6.1 (6A1030) - Apple MACh O-Linker Error - Building

Xcode Version 6.1 (6A1030) - Apple Mach O-Linker Error - Building

As usual when upgrading Xcode:

  • Clean your build folder (Product -> (Alt key) -> Clean Build Folder)
  • Clean project (Product -> Clean)
  • Delete derived data
    • Xcode < 6.3: Window -> Organizer -> Delete derived data
    • Xcode >= 6.3: Window -> Projects (select project) -> Delete derived data

Then try to build your project again.

Xcode 6.1 Compile error

You have mainly 3 problems,

  1. Failable Initializers.

    As mentioned in this article. Swift 1.1 introduces Failable Initializers. It means, initializer can fail and return nil. You have to check it is not nil and unwrap it. This applies to:

    error: value of optional type 'UIImage?' not unwrapped; did you mean to use '!' or '?'?
    error: 'NSURL?' does not have a member named 'lastPathComponent'
  2. CFString handling bug
    See this question:Type 'CFStringRef' does not conform to protocol 'Hashable' in Xcode 6.1. This applies to:

    error: type 'CFString!' does not conform to protocol 'NSCopying'
    error: type 'CFString!' does not conform to protocol 'Hashable'

    The workaround would be like:

    curFrameGIFProperties[kCGImagePropertyGIFUnclampedDelayTime as NSString]
    ^^^^^^^^^^^
  3. enum raw value interface change
    This applies to:

    error: method 'fromRaw' has been replaced with a property 'rawValue'

    Instead of toRaw() method, use rawValue property:

    dictParams += ["category":self.category.rawValue]

Cocoapods with Xcode 6 and 10.10 Yosemite

  1. Open Xcode 6
  2. Open Preferences
  3. Click the Locations tab
  4. Change the Command Line Tools version to Xcode 6.0
  5. Uninstall cocoapods

    $ sudo gem uninstall cocoapods
  6. Uninstall xcodeproj
    $ sudo gem uninstall xcodeproj
  7. Install xcodeproj

    $ sudo gem install xcodeproj
  8. Install cocoapods

    $ sudo gem install cocoapods
  9. Run pod --version to verify that it worked


Related Topics



Leave a reply



Submit