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

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

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

Xcode 7は、ソフトウェア開発のためのアップルの統合開発環境であるXcodeのバージョン。UIを作成するために用いるグラフィカルツールです。iOS9/OS X El Capitan/watchOS2に対応。Swift 2コンパイラーが搭載されています。

Swift

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

Q&A

解決済

1回答

599閲覧

Thread 1: "[<mattingapp.ViewController 0x13c50adf0> setValue:forUndefinedKey:]の直し方

Iori12

総合スコア13

Xcode 7

Xcode 7は、ソフトウェア開発のためのアップルの統合開発環境であるXcodeのバージョン。UIを作成するために用いるグラフィカルツールです。iOS9/OS X El Capitan/watchOS2に対応。Swift 2コンパイラーが搭載されています。

Swift

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

0グッド

0クリップ

投稿2022/09/16 01:01

前提

開発環境 MacBook Air
Xcode14.0

実現したいこと

AppDelegate.swiftに出るエラーが直せないです。

発生している問題・エラーメッセージ

Swift

1Thread 1: "[<mattingapp.ViewController 0x13c50adf0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tappedRegisterButton."

該当のソースコード

Swift

1 2import UIKit 3import Firebase 4 5@UIApplicationMain 6class AppDelegate: UIResponder, UIApplicationDelegate { 7 8 9 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 10 11 FirebaseApp.configure() 12 13 return true 14 } 15 16 // MARK: UISceneSession Lifecycle 17 18 func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 19 // Called when a new scene session is being created. 20 // Use this method to select a configuration to create the new scene with. 21 return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 22 } 23 24 func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { 25 // Called when the user discards a scene session. 26 // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 27 // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 28 } 29 30 31} 32 33

デバックエリアのエラー

2022-09-16 09:39:47.853140+0900 mattingapp[60776:1816924] [Storyboard] Unknown class UIButtom in Interface Builder file. 2022-09-16 09:39:47.874860+0900 mattingapp[60776:1816924] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<mattingapp.ViewController 0x13c50adf0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tappedRegisterButton.' *** First throw call stack: ( 0 CoreFoundation 0x0000000106c30304 __exceptionPreprocess + 172 1 libobjc.A.dylib 0x000000010503131c objc_exception_throw + 56 2 CoreFoundation 0x0000000106c30014 -[NSException init] + 0 3 Foundation 0x00000001091ef1dc -[NSObject(NSKeyValueCoding) setValue:forKey:] + 308 4 UIKitCore 0x000000010aa6e614 -[UIViewController setValue:forKey:] + 76 5 UIKitCore 0x000000010ad75a34 -[UIRuntimeOutletConnection connect] + 80 6 CoreFoundation 0x0000000106c1a600 -[NSArray makeObjectsPerformSelector:] + 192 7 UIKitCore 0x000000010ad6d8a0 -[UINib instantiateWithOwner:options:] + 1408 8 UIKitCore 0x000000010aa74e68 -[UIViewController loadView] + 392 9 UIKitCore 0x000000010aa750ec -[UIViewController loadViewIfRequired] + 96 10 UIKitCore 0x000000010aa7563c -[UIViewController view] + 20 11 UIKitCore 0x000000010b12c3b4 -[UIWindow addRootViewControllerViewIfPossible] + 128 12 UIKitCore 0x000000010b12bdf4 -[UIWindow _updateLayerOrderingAndSetLayerHidden:actionBlock:] + 212 13 UIKitCore 0x000000010b12cc10 -[UIWindow _setHidden:forced:] + 228 14 UIKitCore 0x000000010b13b698 -[UIWindow _mainQueue_makeKeyAndVisible] + 36 15 UIKitCore 0x000000010b321eec -[UIWindowScene _performDeferredInitialWindowUpdateForConnection] + 204 16 UIKitCore 0x000000010a6de0f4 +[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 1096 17 UIKitCore 0x000000010b0f5ff0 -[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 884 18 UIKitCore 0x000000010b0f6478 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 368 19 UIKitCore 0x000000010ac67c48 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 260 20 FrontBoardServices 0x00000001076ff6b4 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 316 21 FrontBoardServices 0x00000001077253b0 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.59 + 92 22 FrontBoardServices 0x000000010770b19c -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 160 23 FrontBoardServices 0x0000000107725038 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 296 24 libdispatch.dylib 0x0000000113c61d5c _dispatch_client_callout + 16 25 libdispatch.dylib 0x0000000113c65974 _dispatch_block_invoke_direct + 392 26 FrontBoardServices 0x0000000107744c90 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 44 27 FrontBoardServices 0x0000000107744b84 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176 28 FrontBoardServices 0x0000000107744cc4 -[FBSSerialQueue _performNextFromRunLoopSource] + 24 29 CoreFoundation 0x0000000106b95070 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 30 CoreFoundation 0x0000000106b94fb8 __CFRunLoopDoSource0 + 172 31 CoreFoundation 0x0000000106b94780 __CFRunLoopDoSources0 + 320 32 CoreFoundation 0x0000000106b8ee68 __CFRunLoopRun + 756 33 CoreFoundation 0x0000000106b8e75c CFRunLoopRunSpecific + 584 34 GraphicsServices 0x000000010826fc98 GSEventRunModal + 160 35 UIKitCore 0x000000010b0f4b74 -[UIApplication _run] + 868 36 UIKitCore 0x000000010b0f8b1c UIApplicationMain + 124 37 mattingapp 0x00000001046a979c main + 64 38 dyld 0x0000000104b51fa0 start_sim + 20 39 ??? 0x0000000104c2d08c 0x0 + 4374843532 40 ??? 0xd803000000000000 0x0 + 15565284737122566144 ) libc++abi: terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<mattingapp.ViewController 0x13c50adf0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tappedRegisterButton.' terminating with uncaught exception of type NSException CoreSimulator 857.7 - Device: iPhone 14 Pro (5D3D895C-46E4-4EFE-9F82-9787C83BBAEA) - Runtime: iOS 16.0 (20A360) - DeviceType: iPhone 14 Pro (lldb)

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

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

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

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

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

hoshi-takanori

2022/09/16 01:11

そのエラーは AppDelegate ではなく、ViewController の IBOutlet 接続に問題があることが多いですね。Storyboard を開いて、IBOutlet 接続をやり直すと良いかも。
Iori12

2022/09/16 01:27

すみません。初心者なので、もう少し詳しく手順などをお答えしていただく事は可能でしょうか?
guest

回答1

0

ベストアンサー

エラーの内容を簡略化/日本語化すると
クラス ViewController には tappedRegisterButton というプロパティはありません。
となります。

なお、@IBOutletまたは@objcが付いていないプロパティはこのエラー検出機構からは存在していないとみなされるので、tappedRegisterButton プロパティがある場合は@IBOutletを付ければよいです。

投稿2022/09/16 06:05

MasakiHori

総合スコア3384

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問