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

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

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

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

Swift

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

Q&A

1回答

1063閲覧

class AppDelegate: UIResponder, UIApplicationDelegate...の所にThread 1: signal SIGABRTの警告が出てしまいます

thetomonari

総合スコア15

Xcode

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

Swift

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

0グッド

0クリップ

投稿2019/06/20 03:19

困っていること

CollectionViewでインスタグラムのような画面三分割を実装しようと思い、SimuSimulatorを起動させた際
以下のような警告が出てしまいました。

"Thread 1: signal SIGABRT" が

Swift

1 2import UIKit 3 4@UIApplicationMain 5class AppDelegate: UIResponder, UIApplicationDelegate { 6 7 var window: UIWindow? 8 9 10 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 11 // Override point for customization after application launch. 12 return true 13 } 14 15 func applicationWillResignActive(_ application: UIApplication) { 16 // 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. 17 // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 18 } 19 20 func applicationDidEnterBackground(_ application: UIApplication) { 21 // 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. 22 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 23 } 24 25 func applicationWillEnterForeground(_ application: UIApplication) { 26 // 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. 27 } 28 29 func applicationDidBecomeActive(_ application: UIApplication) { 30 // 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. 31 } 32 33 func applicationWillTerminate(_ application: UIApplication) { 34 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 35 } 36 37 38} 39

の class AppDelegate: UIResponder, UIApplicationDelegateの所に出てしまいます。

試してみたこと

ViewControllerのoutletの接続などを確認してみましたが、そこには警告は自分が確認した所見当たりませんでした。

Swiftファイルとエラー文

Swift

1import UIKit 2 3class FourthViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout { 4 5 private var timelines: [Timeline] = Timelines.allTimelines() + Timelines.allTimelines() 6 7 override func viewDidLoad() { 8 super.viewDidLoad() 9 10 title = "Search" 11 } 12 13 override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 14 return timelines.count 15 16 } 17 18 override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 19 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Search", for: indexPath) as! SearchCollectionViewCell 20 let timeline = timelines[indexPath.row] 21 cell.timeline = timeline 22 return cell 23 24 } 25 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: NSIndexPath) -> CGSize { 26 let screenWidth = UIScreen.main.bounds.width 27 let width = screenWidth/3 28 return CGSize(width: width, height: width) 29 30 } 31 32 33 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { 34 return 0.0 35 } 36 37 38 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { 39 return 0.0 40 } 41 42} 43
2019-06-20 12:08:40.818764+0900 nowscreen[24517:4596967] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UICollectionViewController loadView] loaded the "XFM-ju-KV6-view-RS7-St-lex" nib but didn't get a UICollectionView.' *** First throw call stack: ( 0 CoreFoundation 0x000000010bb736fb __exceptionPreprocess + 331 1 libobjc.A.dylib 0x000000010996fac5 objc_exception_throw + 48 2 CoreFoundation 0x000000010bb73555 +[NSException raise:format:] + 197 3 UIKitCore 0x0000000110c61399 -[UICollectionViewController loadView] + 802 4 UIKitCore 0x0000000110d23048 -[UIViewController loadViewIfRequired] + 172 5 UIKitCore 0x0000000110d23868 -[UIViewController view] + 27 6 UIKitCore 0x0000000110c59b70 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 472 7 UIKitCore 0x0000000110c58ff9 -[UITabBarController transitionFromViewController:toViewController:] + 59 8 UIKitCore 0x0000000110c552c1 -[UITabBarController _setSelectedViewController:] + 410 9 UIKitCore 0x0000000110c55095 -[UITabBarController setSelectedViewController:] + 109 10 UIKitCore 0x0000000110c58f22 -[UITabBarController _tabBarItemClicked:] + 598 11 UIKitCore 0x0000000111327204 -[UIApplication sendAction:to:from:forEvent:] + 83 12 UIKitCore 0x0000000110b3841c -[UITabBar _sendAction:withEvent:] + 597 13 UIKitCore 0x0000000111327204 -[UIApplication sendAction:to:from:forEvent:] + 83 14 UIKitCore 0x0000000110d7cc19 -[UIControl sendAction:to:forEvent:] + 67 15 UIKitCore 0x0000000110d7cf36 -[UIControl _sendActionsForEvents:withEvent:] + 450 16 UIKitCore 0x0000000110b3ad94 -[UITabBar _buttonUp:] + 113 17 UIKitCore 0x0000000111327204 -[UIApplication sendAction:to:from:forEvent:] + 83 18 UIKitCore 0x0000000110d7cc19 -[UIControl sendAction:to:forEvent:] + 67 19 UIKitCore 0x0000000110d7cf36 -[UIControl _sendActionsForEvents:withEvent:] + 450 20 UIKitCore 0x0000000110d7beec -[UIControl touchesEnded:withEvent:] + 583 21 UIKitCore 0x000000011135feee -[UIWindow _sendTouchesForEvent:] + 2547 22 UIKitCore 0x00000001113615d2 -[UIWindow sendEvent:] + 4079 23 UIKitCore 0x000000011133fd16 -[UIApplication sendEvent:] + 356 24 UIKitCore 0x0000000111410293 __dispatchPreprocessedEventFromEventQueue + 3232 25 UIKitCore 0x0000000111412bb9 __handleEventQueueInternal + 5911 26 CoreFoundation 0x000000010badabe1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 27 CoreFoundation 0x000000010bada463 __CFRunLoopDoSources0 + 243 28 CoreFoundation 0x000000010bad4b1f __CFRunLoopRun + 1231 29 CoreFoundation 0x000000010bad4302 CFRunLoopRunSpecific + 626 30 GraphicsServices 0x00000001108872fe GSEventRunModal + 65 31 UIKitCore 0x0000000111325ba2 UIApplicationMain + 140 32 nowscreen 0x0000000109049f3b main + 75 33 libdyld.dylib 0x000000010cf7b541 start + 1 34 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

教えていただきたいです。よろしくお願いいたします。

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

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

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

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

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

hayabusabusash

2019/06/27 03:47

もしかしてですが、 UIViewControllerだったものを途中からUICollectionViewControllerに変えたりしましたか?
guest

回答1

0

StoryboardのUICollectionViewControllerUICollectionViewが接続されていないようです。

投稿2019/06/20 04:50

MasakiHori

総合スコア3384

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

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

thetomonari

2019/06/23 20:59

すみません。初心者なもので、もう少し説明していただけるとありがたいです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問