title: Fatal trap exceptions in Obj-C / Swift project
body: <p>I'm starting to integrate Swift code into my Obj-C project. Everything's been going smoothly but today, when I updated to Xcode 6.1, things hit the fan. I'm getting a number of "trap" exceptions from Swift code that was previously running fine.</p>
  
  <p><strong>The first crash</strong> is in my extension of UIFont. Here's my code:</p>
  
  <pre><code>class func specialFont() -&gt; UIFont {
      let font = UIFont(name: "FontName", size: 12.0)
      return font!
  }
  </code></pre>
  
  <p>This code was working fine before updating to Xcode 6.1, but now crashes with <code>EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT)</code>, at <code>dylddyld_fatal_error: 0x1fe1608c: trap</code>. (BTW, I don't have an exception breakpoint set.) Attempting to continue program execution doesn't generate a crash log, it just enters an endless cycle of generating that exception. Again, code worked fine before Xcode 6.1 update.</p>
  
  <p><strong>The second crash</strong> is especially strange because it only happens when debugging on a device, not on the simulator. Same exception info as above. Here's the second bit of code that's crashing:</p>
  
  <pre><code>let tap = UITapGestureRecognizer(target: self, action: "didTap")
  self.addGestureRecognizer(tap)
  </code></pre>
  
  <p>Thanks for any help!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Stack trace is below:</p>
  
  <pre><code>0] dyld_fatal_error
  1] dyld_stub_binder
  4] Project.FileWhereCrashTriggers.methodTriggeringCrash
  5] @objc Project.FileWhereCrashTriggers.methodTriggeringCrash
  6] -- continued trace up to call of method crashing
  </code></pre>
  
  <p>One weird thing about these crashes is that they don't trigger the exception on the actual line of code, as you can see from the stack trace. They break in dyld_fatal_error.</p>
  
  <p>I can't upload any console output because the app never actually crashes while running in Xcode - it calls endlessly similar to EXC_BAD_ACCESS. I triggered the crash in non-debug mode and then looked at the device logs using Organizer and this is what it offered:</p>
  
  <blockquote>
    <p>Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
    Triggered by Thread:  0</p>
    
    <p>Dyld Error Message:
      Symbol not found: __TFSSCfMSSFT21_builtinStringLiteralBp8byteSizeBw7isASCIIBi1__SS
      Referenced from: /private/var/mobile/Containers/Bundle/Application/4ABA71F8-A6D1-4E4B-A452-DE339065310A/Project.app/Project</p>
    
    <p>Expected in: /private/var/mobile/Containers/Bundle/Application/4ABA71F8-A6D1-4E4B-A452-DE339065310A/Project.app/Frameworks/libswiftCore.dylib
      Dyld Version: 353.5</p>
  </blockquote>