2017-02-21 14 views
-1

코드에 SIGABRT 오류가 계속 표시되며 이유를 알 수 없습니다. 나는 아주 단순한 오류를 보는 것으로 끝났으며 나는 그걸 알아낼 수 없다고 생각합니다.IBAction Swift에서 충돌 발생

UIButton을 클릭 할 때마다 내 응용 프로그램 충돌 문제가 IBOutlet 내에있는 것으로 보입니다.

SIGABRT 오류가 AppDelagate

SignInViewController의 시작 부분에서 시작합니다

import UIKit 

import Firebase 
import GoogleSignIn 

@objc(SignInViewController) 
class SignInViewController: UIViewController, GIDSignInUIDelegate { 

    //@IBOutlet weak var signInButton: GIDSignInButton! 

    @IBOutlet weak var signInButton: GIDSignInButton! 

    // @IBOutlet weak var signInButton: GIDSignInButton! 
    var handle: FIRAuthStateDidChangeListenerHandle? 

    override func viewDidLoad() { 
     super.viewDidLoad() 
     GIDSignIn.sharedInstance().uiDelegate = self 
     GIDSignIn.sharedInstance().signInSilently() 
     handle = FIRAuth.auth()?.addStateDidChangeListener() { (auth, user) in 
      if user != nil { 
       MeasurementHelper.sendLoginEvent() 
       self.performSegue(withIdentifier: Constants.Segues.SignInToFp, sender: nil) 
      } 
     } 
    } 

    deinit { 
     if let handle = handle { 
      FIRAuth.auth()?.removeStateDidChangeListener(handle) 
     } 
    } 
} 

Applegate.swift :

import UIKit 
// UserNotifications are only required for the optional FCM step 
import UserNotifications 

import Firebase 
import GoogleSignIn 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate { 

    var window: UIWindow? 

    @available(iOS 9.0, *) 
    func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) 
     -> Bool { 
      return self.application(application, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: "") 
    } 

    func application(_ application: UIApplication, 
        open url: URL, sourceApplication: String?, annotation: Any) -> Bool { 
     return GIDSignIn.sharedInstance().handle(url, sourceApplication: sourceApplication, annotation: annotation) 
    } 

    func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) { 
     if let error = error { 
      print("Error \(error)") 
      return 
     } 

     guard let authentication = user.authentication else { return } 
     let credential = FIRGoogleAuthProvider.credential(withIDToken: authentication.idToken, 
                  accessToken: authentication.accessToken) 
     FIRAuth.auth()?.signIn(with: credential) { (user, error) in 
      if let error = error { 
       print("Error \(error)") 
       return 
      } 
     } 
    } 

    func application(_ application: UIApplication, didFinishLaunchingWithOptions 
     launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 


     FIRApp.configure() 
     GIDSignIn.sharedInstance().clientID = FIRApp.defaultApp()?.options.clientID 
     GIDSignIn.sharedInstance().delegate = self 

     return true 
    } 
} 
+1

더 유용한 정보를 제공해 줄 수 있습니까?이 정보를 바탕으로 소스를 찾기가 어려울 수 있습니다. – aircraft

+0

어떤 UIButton 및 어떤 View Controller가 그 버튼에 놓여 있습니까? –

답변

0

이것은 일반적으로 인한하지 않는 IBOutlet에. 각 콘센트를 storyboard에서 마우스 오른쪽 버튼으로 클릭하고 viewcontroller에서 사용되지 않았거나 참조되지 않은 콘센트를 제거 (x 클릭)하십시오.