Thread 1: signal sigabrt

Hello,

I'm having an issue with my single view app. The build is succeeded but the excution fails. Here is the main code -- ViewController.swift --:

 //  

// ViewController.swift
// Décodeur
//
// Created by Boustani on 9/23/19.
// Copyright © 2019 Stif. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
@IBOutlet weak var champMessageCodé: UITextField!

@IBOutlet weak var libelléMessageDécodé: UILabel!  
  
override func viewDidLoad() {  
    super.viewDidLoad()  
    mettreÀJourMessageDécodé()  
    champMessageCodé.becomeFirstResponder()  
}  
  
@IBAction func champTexteAChangé(_ sender: Any) {  
    mettreÀJourMessageDécodé()  
}  
private static func décoder(message messageCodé: String) -> String {  
    return String(messageCodé.reversed())  
}  
func mettreÀJourMessageDécodé() {  
    let texteEntré = champMessageCodé.text ?? ""  
    let messageDécodé = ViewController.décoder(message:texteEntré)  
    libelléMessageDécodé.text = messageDécodé  
}  

}

And here is my stacktrace:

2019-09-29 22:05:36.999631+0100 Décodeur[32109:3024886] Unknown class _TtC9Décodeur14ViewController in Interface Builder file.

2019-09-29 22:05:37.214381+0100 Décodeur[32109:3024886] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7ff368f07be0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key champMessageCodé.'

***** First throw call stack:**

(

0 CoreFoundation 0x00000001093bf8db __exceptionPreprocess + 331

1 libobjc.A.dylib 0x00000001079d6ac5 objc_exception_throw + 48

2 CoreFoundation 0x00000001093bf449 -[NSException raise] + 9

3 Foundation 0x000000010744b3a6 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 289

4 UIKitCore 0x000000010bb11f8e -[UIViewController setValue:forKey:] + 87

5 UIKitCore 0x000000010bd9fcd9 -[UIRuntimeOutletConnection connect] + 109

6 CoreFoundation 0x00000001093abf21 -[NSArray makeObjectsPerformSelector:] + 305

7 UIKitCore 0x000000010bd9ca1f -[UINib instantiateWithOwner:options:] + 1810

8 UIKitCore 0x000000010bb1906b -[UIViewController _loadViewFromNibNamed:bundle:] + 382

9 UIKitCore 0x000000010bb199f5 -[UIViewController loadView] + 177

10 UIKitCore 0x000000010bb19d04 -[UIViewController loadViewIfRequired] + 172

11 UIKitCore 0x000000010bb1a524 -[UIViewController view] + 27

12 UIKitCore 0x000000010c15322b -[UIWindow addRootViewControllerViewIfPossible] + 122

13 UIKitCore 0x000000010c15391f -[UIWindow _setHidden:forced:] + 289

14 UIKitCore 0x000000010c16657e -[UIWindow makeKeyAndVisible] + 42

15 UIKitCore 0x000000010c11633c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4555

16 UIKitCore 0x000000010c11b4e6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1617

17 UIKitCore 0x000000010b95fa4e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 904

18 UIKitCore 0x000000010b968346 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153

19 UIKitCore 0x000000010b95f664 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236

20 UIKitCore 0x000000010b95ffc0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1091

21 UIKitCore 0x000000010b95e332 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 782

22 UIKitCore 0x000000010b95dfe9 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433

23 UIKitCore 0x000000010b962d2e __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 576

24 UIKitCore 0x000000010b963988 _performActionsWithDelayForTransitionContext + 100

25 UIKitCore 0x000000010b962a95 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223

26 UIKitCore 0x000000010b967a48 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392

27 UIKitCore 0x000000010c119dc8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 514

28 UIKitCore 0x000000010bcd102f -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361

29 FrontBoardServices 0x00000001145fcd25 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448

30 FrontBoardServices 0x0000000114606ad6 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 283

31 FrontBoardServices 0x0000000114606300 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53

32 libdispatch.dylib 0x000000010a757db5 _dispatch_client_callout + 8

33 libdispatch.dylib 0x000000010a75b2ba _dispatch_block_invoke_direct + 300

34 FrontBoardServices 0x00000001146380da FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 30

35 FrontBoardServices 0x0000000114637d92 -[FBSSerialQueue _performNext] + 451

36 FrontBoardServices 0x0000000114638327 -[FBSSerialQueue _performNextFromRunLoopSource] + 42

37 CoreFoundation 0x0000000109326db1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17

38 CoreFoundation 0x0000000109326633 __CFRunLoopDoSources0 + 243

39 CoreFoundation 0x0000000109320cef __CFRunLoopRun + 1231

40 CoreFoundation 0x00000001093204d2 CFRunLoopRunSpecific + 626

41 GraphicsServices 0x00000001115582fe GSEventRunModal + 65

42 UIKitCore 0x000000010c11cfc2 UIApplicationMain + 140

43 DeÃÅcodeur 0x00000001070f58eb main + 75

44 libdyld.dylib 0x000000010a7cc541 start + 1

45 ??? 0x0000000000000001 0x0 + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)

Check your outlet connection for libelléMessageDécodé in Interface Builder. Also, check if the XIB's class is set to ViewController.

This is the problem. Interface builder references a class that does not exist in your source. Voici le problème. Interface Builder fait référence à une classe qui n’existe pas dans votre code source.
Presumably your module name is Décodeur? In that case, you probably have done nothing wrong. It is just that Xcode handles the “é” poorly. Je présume que votre module s’appelle Décodeur ? En ce cas, vous avez probablement fait aucune erreur. C’est juste que Xcode se laisse confondre par le « é ».
You can help Xcode along by making sure the “é” is always encoded the same. There are two ways to encode it: “e” (U+0065) + “◌́” (U+0301) or “é” (U+00E9). Vous pouvez aider Xcode un peu en faisant attention que le « é » soit toujours encodé le même. Il y a deux façons de l’encoder : « e » (U+0065) + « ◌́ » (U+0301) ou « é » (U+00E9).
Or you could choose a different name that does not contain any characters beyond ASCII (sadly). Ou vous pouvez choisir un autre nom, qui ne contient pas de caractère hors de ASCII (malheureusement).
9 Likes

Liked, just for the format. :grin:

2 Likes