Xcode 6 Swift de la Conversion de String en Int dans textfields

donc, j'ai été bloqué avec ce problème depuis très longtemps maintenant et je ne peux pas le comprendre.

donc, mon idée de base est que j'ai 2 objets textfield, où l'utilisateur met dans un certain nombre (je ne sais pas comment faire pour ouvrir le clavier mais ce serait bien si quelqu'un savait comment) dans les deux objets textfield et je veux diviser ces nombres l'un par l'autre.

< Label.texte = (Textfield1.texte) /(Textfield2.texte) >

je me suis donc 3 variables, d'une étiquette, et deux objets textfield, mais je continue de me donner cette erreur que la chaîne n'est pas convertible en un UIint8.

voici une capture d'écran avec le code

Xcode 6 Swift de la Conversion de String en Int dans textfields

voici le storyboard

Xcode 6 Swift de la Conversion de String en Int dans textfields
PS: je suis un peu nouveau pour cette Xcode, de sorte que le problème pourrait être VRAIMENT évident :/

voici le code d'erreur (il m'a donné une erreur quand je l'ai fait sans

laisser answer2 = textfield1.texte.toInt()! /textfield2.texte.toInt()!

2014-09-12 15:16:05.764 lb[3107:261572] * fin de l'app en raison de uncaught exception 'NSUnknownKeyException', la raison: '[ setValue:forUndefinedKey:]: cette classe n'est pas la valeur de la clé de codage conforme à la clé ButtonO.'
*
Premier lancer de pile d'appel:
(
0 CoreFoundation 0x000000010f2fb3e5 exceptionPreprocess + 165
1 libobjc.Un.dylib 0x0000000110e11967 objc_exception_throw + 45
2 CoreFoundation 0x000000010f2fb029 -[NSException soulever] + 9
3 Fondation 0x000000010f713383 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x000000010f2453f0 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010fe4716d -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x000000010fca9d78 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x000000010fcaa368 -[UIViewController loadView] + 109
8 UIKit 0x000000010fcaa5d9 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x000000010fcaaa6e -[UIViewController vue] + 27
10 UIKit 0x000000010fbcb2b1 -[UIWindow addRootViewControllerViewIfPossible] + 58
11 UIKit 0x000000010fbcb64a -[UIWindow _setHidden:forced:] + 276
12 UIKit 0x000000010fbd7a81 -[UIWindow makeKeyAndVisible] + 42
13 UIKit 0x000000010fb825cd -[UIApplication _callInitializationDelegatesForMainscene:transitionContext:] + 2628
14 UIKit 0x000000010fb8529c -[UIApplication _runWithMainScene:transitionContext:achèvement:] + 1350
15 UIKit 0x000000010fb84168 -[UIApplication workspaceDidEndTransaction:] + 179
16 FrontBoardServices 0x0000000112665513 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
17 CoreFoundation 0x000000010f230aac __CFRUNLOOP_EST_APPEL_OUT_DE_LA_le BLOC
+ 12
18 CoreFoundation 0x000000010f2267f5 __CFRunLoopDoBlocks + 341
19 CoreFoundation 0x000000010f2265b5 __CFRunLoopRun + 2389
20 CoreFoundation 0x000000010f2259f6 CFRunLoopRunSpecific + 470
21 UIKit 0x000000010fb83bdf -[UIApplication _run] + 413
22 UIKit 0x000000010fb86990 UIApplicationMain + 1282
23 lb 0x000000010edb6e5e top_level_code + 78
24 lb 0x000000010edb6e9a principal + 42
25 libdyld.dylib 0x00000001113b3145 début + 1
26 ??? 0 x 0 0 x 0000000000000001 + 1
)
libc++abi.dylib: la fin avec uncaught exception de type NSException
(lldb)

InformationsquelleAutor Alexander | 2014-09-08