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

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

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

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

Swift

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

Q&A

0回答

950閲覧

swiftThread 1: Exception: "-[UIViewController tableView:numberOfRowsInSection:]: unrecognized select

Kumt

総合スコア4

Xcode

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

Swift

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

0グッド

0クリップ

投稿2020/06/12 16:02

下記のコードでビルドした際にタイトルに書いてあるエラーが出ます。

swift

1import UIKit 2 3class technique:UIViewController,UITableViewDelegate,UITableViewDataSource { 4 5 let technique = ["FX","te"] 6 7 override func viewDidLoad() { 8 super.viewDidLoad() 9 10 // Do any additional setup after loading the view. 11 } 12 13 func tableView(_ tableView:UITableView,numberOfRowsInSection section: Int) -> Int { 14 return technique.count 15 } 16 17 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 18 let cell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 19 cell.textLabel!.text = technique[indexPath.row] 20 return cell 21 } 22 23 24 25 26}

コンソールは下記です。

2020-06-13 01:00:35.366275+0900 FX quiz[43814:3477719] [Storyboard] Unknown class technique in Interface Builder file. 2020-06-13 01:00:35.417269+0900 FX quiz[43814:3477719] -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fc28e405f90 2020-06-13 01:00:35.473637+0900 FX quiz[43814:3477719] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fc28e405f90' *** First throw call stack: ( 0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23e5dc34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 UIKitCore 0x00007fff48cbab74 -[UIResponder doesNotRecognizeSelector:] + 302 4 CoreFoundation 0x00007fff23e4190c ___forwarding___ + 1436 5 CoreFoundation 0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120 6 UIKitCore 0x00007fff48eb0463 -[UITableView _numberOfRowsInSection:] + 62 7 UIKitCore 0x00007fff48ec4ee2 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 1960 8 UIKitCore 0x00007fff48ecab2e -[UITableViewRowData rectForFooterInSection:heightCanBeGuessed:] + 94 9 UIKitCore 0x00007fff48ecadbb -[UITableViewRowData heightForTable] + 54 10 UIKitCore 0x00007fff48e6300a -[UITableView _updateContentSizeSkippingContentOffsetAdjustment:] + 354 11 UIKitCore 0x00007fff48e9107b -[UITableView _rebuildGeometryForcingRowDataUpdate:skipContentOffsetAdjustment:updateImmediatelyIfPossible:] + 138 12 UIKitCore 0x00007fff48e8ee83 -[UITableView setLayoutMargins:] + 317 13 UIKitCore 0x00007fff48e8ed23 -[UITableView _setDefaultLayoutMargins:] + 89 14 UIKitCore 0x00007fff48e8eca1 -[UITableView didMoveToWindow] + 352 15 UIKitCore 0x00007fff49189f78 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 2140 16 UIKitCore 0x00007fff491006fb -[UIScrollView _didMoveFromWindow:toWindow:] + 88 17 UIKitCore 0x00007fff491899ec -[UIView(Internal) _didMoveFromWindow:toWindow:] + 720 18 UIKitCore 0x00007fff491899ec -[UIView(Internal) _didMoveFromWindow:toWindow:] + 720 19 UIKitCore 0x00007fff4917d319 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 130 20 UIKitCore 0x00007fff4917d21e -[UIView(Hierarchy) _postMovedFromSuperview:] + 800 21 UIKitCore 0x00007fff4918c7b4 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1718 22 UIKitCore 0x00007fff486076d5 -[UIViewControllerBuiltinTransitionViewAnimator animateTransition:] + 3682 23 UIKitCore 0x00007fff4860f516 ___UIViewControllerTransitioningRunCustomTransition_block_invoke_2 + 59 24 UIKitCore 0x00007fff48732073 +[UIInputResponderController _pinInputViewsForInputResponderController:onBehalfOfResponder:duringBlock:] + 99 25 UIKitCore 0x00007fff4860f4a5 ___UIViewControllerTransitioningRunCustomTransition_block_invoke.645 + 180 26 UIKitCore 0x00007fff49185403 +[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:] + 175 27 UIKitCore 0x00007fff4860f32b _UIViewControllerTransitioningRunCustomTransition + 553 28 UIKitCore 0x00007fff484f1bb7 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke.465 + 2598 29 UIKitCore 0x00007fff484f7569 +[UIPresentationController _scheduleTransition:] + 79 30 UIKitCore 0x00007fff484f0f26 -[UIPresentationController runTransitionForCurrentState] + 1702 31 UIKitCore 0x00007fff484ee058 -[UIPresentationController _presentWithAnimationController:interactionController:target:didEndSelector:] + 1033 32 UIKitCore 0x00007fff48cc4452 -[UIWindow addRootViewControllerViewIfPossible] + 571 33 UIKitCore 0x00007fff48cc3986 -[UIWindow _updateLayerOrderingAndSetLayerHidden:actionBlock:] + 219 34 UIKitCore 0x00007fff48cc4a11 -[UIWindow _setHidden:forced:] + 362 35 UIKitCore 0x00007fff48cd7e4d -[UIWindow _mainQueue_makeKeyAndVisible] + 42 36 UIKitCore 0x00007fff48ef9d63 -[UIWindowScene _makeKeyAndVisibleIfNeeded] + 202 37 UIKitCore 0x00007fff481e7d60 +[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 1405 38 UIKitCore 0x00007fff48c87d2d -[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 1019 39 UIKitCore 0x00007fff48c88064 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 291 40 UIKitCore 0x00007fff487da8dc -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361 41 FrontBoardServices 0x00007fff36cacd2e -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 419 42 FrontBoardServices 0x00007fff36cd2dc1 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102 43 FrontBoardServices 0x00007fff36cb7757 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220 44 FrontBoardServices 0x00007fff36cd2a52 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355 45 libdispatch.dylib 0x000000010eb31e8e _dispatch_client_callout + 8 46 libdispatch.dylib 0x000000010eb34da2 _dispatch_block_invoke_direct + 300 47 FrontBoardServices 0x00007fff36cf86e9 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30 48 FrontBoardServices 0x00007fff36cf83d7 -[FBSSerialQueue _queue_performNextIfPossible] + 441 49 FrontBoardServices 0x00007fff36cf88e6 -[FBSSerialQueue _performNextFromRunLoopSource] + 22 50 CoreFoundation 0x00007fff23da0d31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 51 CoreFoundation 0x00007fff23da0c5c __CFRunLoopDoSource0 + 76 52 CoreFoundation 0x00007fff23da048c __CFRunLoopDoSources0 + 268 53 CoreFoundation 0x00007fff23d9b02e __CFRunLoopRun + 974 54 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404 55 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139 56 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605 57 FX quiz 0x000000010e8b403b main + 75 58 libdyld.dylib 0x00007fff51a231fd start + 1 59 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

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

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

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

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

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

hoshi-takanori

2020/06/13 12:49

storyboard の view controller のクラス指定が間違ってるのでは。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問