質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Q&A

解決済

1回答

4517閲覧

IOSでFirebaseを使ってチャットアプリを作りましたが、エラーが出て起動しません。

jiuiuoiui

総合スコア24

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

0グッド

0クリップ

投稿2016/11/25 07:04

IOSでFirebaseを使って、簡易的なチャットアプリを作りました。しかし、起動時にエラーがでてしまいます。

ViewController.siwft

swift

1import UIKit 2import Firebase 3 4class ViewController: UIViewController,UITextFieldDelegate { 5 6 @IBOutlet weak var textView: UITextView! 7 8 9 @IBOutlet weak var messageTextField: UITextField! 10 11 var dataBaseRef:FIRDatabaseReference! 12 @IBOutlet weak var nameTextField: UITextField! 13 14 override func viewDidLoad() { 15 super.viewDidLoad() 16 17 messageTextField.delegate = self 18 nameTextField.delegate = self 19 20 dataBaseRef = FIRDatabase.database().reference() 21 // Do any additional setup after loading the view, typically from a nib. 22 23 dataBaseRef.observe(.childAdded, with: { FIRDataSnapshot in 24 if let name = FIRDataSnapshot.value(forKey: "name") as? String, 25 let message = FIRDataSnapshot.value(forKey: "message") as? String { 26 self.textView.text = "\(self.textView.text)\n\(name) : \(message)" 27 } 28 }) 29 } 30 31 func textFieldShouldReturn(_ textField: UITextField) -> Bool { 32 33 let messageData = ["name": nameTextField.text!, "message": messageTextField.text!] 34 dataBaseRef.childByAutoId().setValue(messageData) 35 textField.resignFirstResponder() 36 messageTextField.text = "" 37 38 return true 39 } 40 41 override func didReceiveMemoryWarning() { 42 super.didReceiveMemoryWarning() 43 // Dispose of any resources that can be recreated. 44 } 45}

AppDelegate.swift

swift

1import UIKit 2import Firebase 3 4@UIApplicationMain 5class AppDelegate: UIResponder, UIApplicationDelegate { //ここでThread 1: signal SIGABRTが出ます。 6 7 var window: UIWindow? 8 9 10 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 11 // Override point for customization after application launch. 12 FIRApp.configure() 13 return true 14 } 15 16 func applicationWillResignActive(_ application: UIApplication) { 17 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 18 // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 19 } 20 21 func applicationDidEnterBackground(_ application: UIApplication) { 22 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 23 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 24 } 25 26 func applicationWillEnterForeground(_ application: UIApplication) { 27 // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 28 } 29 30 func applicationDidBecomeActive(_ application: UIApplication) { 31 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 32 } 33 34 func applicationWillTerminate(_ application: UIApplication) { 35 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 36 } 37}

デバッグエリアの最後には以下のようなメッセージがありました。
libc++abi.dylib: terminating with uncaught exception of type NSException
おそらくこのエラーが原因だと思うのですが、直し方がわかりません。
回答宜しくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

libc++abi.dylib: terminating with uncaught exception of type NSException
おそらくこのエラーが原因だと思うのですが、直し方がわかりません。

このメッセージのかなり前(「First throw call stack」の前)に、「*** Terminating app due to uncaught exception 〜 reason: 〜」というメッセージがあると思いますので、そこの「reason:」の後のメッセージを読んでください。
そこに問題の原因が書かれています。

投稿2016/11/26 02:25

TakeOne

総合スコア6299

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問