title: EXC_BREAKPOINT at appInviteDialog didCompleteWithResults delegate method | Facebook App Invite
body: <p>I am getting the following crash report from crashlytics. My app crashes when receiving the delegate method of appInviteDialog of Facebook sdk on iOS. The issue is ImplicitlyUnwrappedOptional so it seems like facebook is sending nil on the delegate method. But I am not sure. 
  Does anyone have any idea if it is a bug on the FB SDK or am I doing something wrong?</p>
  
  <pre><code>Thread : Crashed: com.apple.main-thread
  0  MY_APP                     0x00000001000a7c28 function signature specialization &lt;Arg[0] = Owned To Guaranteed, Arg[1] = Owned To Guaranteed, Arg[2] = Owned To Guaranteed&gt; of MY_APP.GameScene.appInviteDialog (MY_APP.GameScene)(Swift.ImplicitlyUnwrappedOptional&lt;ObjectiveC.FBSDKAppInviteDialog&gt;, didCompleteWithResults : Swift.ImplicitlyUnwrappedOptional&lt;Swift.Dictionary&lt;ObjectiveC.NSObject, Swift.AnyObject&gt;&gt;) -&gt; () (GameScene.swift:1569)
  1  MY_APP                     0x00000001000884c4 @objc MY_APP.GameScene.appInviteDialog (MY_APP.GameScene)(Swift.ImplicitlyUnwrappedOptional&lt;ObjectiveC.FBSDKAppInviteDialog&gt;, didCompleteWithResults : Swift.ImplicitlyUnwrappedOptional&lt;Swift.Dictionary&lt;ObjectiveC.NSObject, Swift.AnyObject&gt;&gt;) -&gt; () (GameScene.swift)
  2  MY_APP                     0x00000001005588a4 -[FBSDKAppInviteDialog _invokeDelegateDidCompleteWithResults:] (FBSDKAppInviteDialog.m:143)
  3  MY_APP                     0x0000000100558744 -[FBSDKAppInviteDialog _handleCompletionWithDialogResults:error:] (FBSDKAppInviteDialog.m:124)
  4  MY_APP                     0x0000000100558510 __28-[FBSDKAppInviteDialog show]_block_invoke (FBSDKAppInviteDialog.m:83)
  5  MY_APP                     0x00000001005585f0 __28-[FBSDKAppInviteDialog show]_block_invoke64 (FBSDKAppInviteDialog.m:98)
  6  MY_APP                     0x000000010038b4c4 -[FBSDKApplicationDelegate applicationDidBecomeActive:] (FBSDKApplicationDelegate.m:178)
  7  CoreFoundation                 0x00000001862ee010 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
  8  CoreFoundation                 0x000000018622b0f0 _CFXNotificationPost + 2060
  9  Foundation                     0x000000018715aa80 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
  10 UIKit                          0x000000018ae47298 -[UIApplication _stopDeactivatingForReason:] + 516
  11 UIKit                          0x000000018b059458 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:] + 2716
  12 UIKit                          0x000000018b04f9f0 -[UIApplication workspace:didReceiveActions:] + 128
  13 FrontBoardServices             0x000000018eb893c8 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 32
  14 CoreFoundation                 0x00000001862fffc8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
  15 CoreFoundation                 0x00000001862ff0d0 __CFRunLoopDoBlocks + 312
  16 CoreFoundation                 0x00000001862fd6f4 __CFRunLoopRun + 1756
  17 CoreFoundation                 0x0000000186228f74 CFRunLoopRunSpecific + 396
  18 GraphicsServices               0x000000018fc8b6fc GSEventRunModal + 168
  19 UIKit                          0x000000018ae2ad94 UIApplicationMain + 1488
  20 MY_APP                     0x00000001000c2c58 main (AppDelegate.swift:16)
  21 libdyld.dylib                  0x000000019866ea08 start + 4
  </code></pre>
  
  <p>Here is my code in GameScene file. Please note that it is a delegate method:</p>
  
  <pre><code>func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didCompleteWithResults results: [NSObject : AnyObject]!) {
      if(results.count == 1){
          println("facebook invite successful \(results)")
          if(self.isSaveMeButtonPressed){
              Flurry.logEvent("FBInvite")
              var build = GAIDictionaryBuilder.createEventWithCategory("Growth", action: "Facebook", label: "FBInvite", value: nil).build() as [NSObject : AnyObject]
              googleTracker.send(build)
          }
      }
  }
  </code></pre>
  
  <p>The line number shown in the crash report is the closing bracket of the function (last line of the function). Note that the app doesn't always crash, in fact I haven't been able to reproduce said crash till now.</p>