Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何使用swift在故事板中从一个viewcontroller移动到另一个viewcontroller_Ios_Swift_Xcode_Storyboard - Fatal编程技术网

Ios 如何使用swift在故事板中从一个viewcontroller移动到另一个viewcontroller

Ios 如何使用swift在故事板中从一个viewcontroller移动到另一个viewcontroller,ios,swift,xcode,storyboard,Ios,Swift,Xcode,Storyboard,我试图在点击按钮时从SignenView控制器移动到RegisterUserService控制器。下面是代码 @IBAction func RegisterNewAccountButtonTapped(_ sender: Any) { print("Register account button tapped") //RegisterUserViewController // let storyboard = UIStoryboard(n

我试图在点击按钮时从SignenView控制器移动到RegisterUserService控制器。下面是代码

   @IBAction func RegisterNewAccountButtonTapped(_ sender: Any) {
         print("Register account button tapped")
        //RegisterUserViewController


       // let storyboard = UIStoryboard(name: "SignInViewController", bundle: nil)
        let vc = self.storyboard?.instantiateViewController(withIdentifier: "RegisterUserViewController") as! RegisterUserViewController
        self.present(vc, animated: true)
    }
这张图片中有类和故事板id 按下“注册新帐户”按钮时出现错误

   2018-04-27 06:09:24.720143-0700 UserRegistrationExample[10193:1788611] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UserRegistrationExample.RegisterUserViewController 0x7f84b4f171b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key repeatPasswordTextField.'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x000000010db1826b __exceptionPreprocess + 171
        1   libobjc.A.dylib                     0x000000010a1fbf41 objc_exception_throw + 48
        2   CoreFoundation                      0x000000010db181b9 -[NSException raise] + 9
        3   Foundation                          0x0000000109c20883 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
        4   UIKit                               0x000000010a95dd56 -[UIViewController setValue:forKey:] + 87
        5   UIKit                               0x000000010ac3ac94 -[UIRuntimeOutletConnection connect] + 109
        6   CoreFoundation                      0x000000010dabb61d -[NSArray makeObjectsPerformSelector:] + 317
        7   UIKit                               0x000000010ac3964a -[UINib instantiateWithOwner:options:] + 1856
        8   UIKit                               0x000000010a964d49 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
        9   UIKit                               0x000000010a965652 -[UIViewController loadView] + 177
        10  UIKit                               0x000000010a965983 -[UIViewController loadViewIfRequired] + 195
        11  UIKit                               0x000000010a9661e0 -[UIViewController view] + 27
        12  UIKit                               0x000000010b3bd39d -[_UIFullscreenPresentationController _setPresentedViewController:] + 89
        13  UIKit                               0x000000010a936a8f -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 133
        14  UIKit                               0x000000010a979338 -[UIViewController _presentViewController:withAnimationController:completion:] + 3808
        15  UIKit                               0x000000010a97c14a __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 134
        16  UIKit                               0x000000010a97c5ea -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 532
        17  UIKit                               0x000000010a97c086 -[UIViewController presentViewController:animated:completion:] + 181
        18  UserRegistrationExample             0x00000001098e0ae5 _T023UserRegistrationExample20SignInViewControllerC30RegisterNewAccountButtonTappedyypF + 1077
        19  UserRegistrationExample             0x00000001098e0c58 _T023UserRegistrationExample20SignInViewControllerC30RegisterNewAccountButtonTappedyypFTo + 72
        20  UIKit                               0x000000010a7cd631 -[UIApplication sendAction:to:from:forEvent:] + 83
        21  UIKit                               0x000000010a942000 -[UIControl sendAction:to:forEvent:] + 67
        22  UIKit                               0x000000010a94231d -[UIControl _sendActionsForEvents:withEvent:] + 450
        23  UIKit                               0x000000010a94124a -[UIControl touchesEnded:withEvent:] + 618
        24  UIKit                               0x000000010a840bf1 -[UIWindow _sendTouchesForEvent:] + 2807
        25  UIKit                               0x000000010a842314 -[UIWindow sendEvent:] + 4124
        26  UIKit                               0x000000010a7e82da -[UIApplication sendEvent:] + 352
        27  UIKit                               0x000000010b0f6f18 __dispatchPreprocessedEventFromEventQueue + 2809
        28  UIKit                               0x000000010b0f9a7f __handleEventQueueInternal + 5957
        29  CoreFoundation                      0x000000010dabb351 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        30  CoreFoundation                      0x000000010db5ad71 __CFRunLoopDoSource0 + 81
        31  CoreFoundation                      0x000000010da9fcb9 __CFRunLoopDoSources0 + 185
        32  CoreFoundation                      0x000000010da9f29f __CFRunLoopRun + 1279
        33  CoreFoundation                      0x000000010da9eb29 CFRunLoopRunSpecific + 409
        34  GraphicsServices                    0x00000001101af9c6 GSEventRunModal + 62
        35  UIKit                               0x000000010a7cb9a4 UIApplicationMain + 159
        36  UserRegistrationExample             0x00000001098deee7 main + 55
        37  libdyld.dylib                       0x000000010ec3a621 start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
2018-04-27 06:09:24.720143-0700 UserRegistrationExample[10193:1788611]***由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:::]:该类与key repeatPasswordTextField的键值编码不兼容。”
***第一次抛出调用堆栈:
(
0 CoreFoundation 0x000000010db1826b例外预处理+171
1 libobjc.A.dylib 0x000000010a1fbf41 objc_异常_抛出+48
2 CoreFoundation 0x000000010db181b9-[N异常提升]+9
3基金会0x000 000 0109C2083- [ NSObjices(NSKEY ValueCudid)StValue:FordK::] + 292
4 UIKit 0x000000010a95dd56-[UIViewController设置值:forKey:+87
5 UIKit 0x000000010ac3ac94-[UIRuntimeOutletConnection connect]+109
6 CoreFoundation 0x000000010dabb61d-[NSArray makeObjectsPerformSelector:+317
7 UIKit 0x000000010ac3964a-[UINib实例化所有者:选项:][1856
8 UIKit 0x000000010a964d49-[UIViewController\u loadViewFromNibNamed:bundle:][383
9 UIKit 0x000000010a965652-[UIViewController loadView]+177
10 UIKit 0x000000010a965983-[UIViewController loadViewIfRequired]+195
11 UIKit 0x000000010a9661e0-[UIViewController视图]+27
12 UIKit 0x000000010b3bd39d-[\u UIFullScreen显示控制器\u setPresentedViewController:+89
13 UIKit 0x000000010a936a8f-[UIPresentationController初始化与PresentedViewController:presentingViewController:+133
14 UIKit 0x000000010a979338-[UIViewController\u presentViewController:withAnimationController:completion:+3808
15 UIKit 0x000000010a97c14a \uuuu 62-[UIViewController当前视图控制器:动画:完成:]\u块\u调用+134
16 UIKit 0x000000010a97c5ea-[UIViewController\u性能协调演示文稿:动画:][532
17 UIKit 0x000000010a97c086-[UIViewController当前视图控制器:动画:完成:][181
18用户注册示例0x00000001098e0ae5\u T023用户注册示例20SignInviewController 30注册帐户按钮附件YPF+1077
19用户注册示例0x00000001098e0c58\u T023用户注册示例20SignInviewController 30注册帐户按钮附件Fto+72
20 UIKit 0x000000010a7cd631-[UIApplication sendAction:to:from:forEvent:][83
21 UIKit 0x000000010a942000-[UIControl发送操作:到:forEvent:+67
22 UIKit 0x000000010a94231d-[UIControl\u发送操作预防:带事件:][450
23 UIKit 0x000000010a94124a-[UIControl触摸附加:带事件:][618
24 UIKit 0x000000010a840bf1-[UIWindow\u sendTouchesForEvent:+2807
25 UIKit 0x000000010a842314-[UIWindow sendEvent:+4124
26 UIKit 0x000000010a7e82da-[UIApplication sendEvent:+352
27 UIKit 0x000000010b0f6f18 uuu调度预处理事件RomeventQueue+2809
28 UIKit 0x000000010b0f9a7f__________________内部+5957
29 CoreFoundation 0x000000010dabb351 \uuuu CFRUNLOOP\u正在调用\u OUT\u以执行\u函数\uuu+17
30 CoreFoundation 0x000000010db5ad71__CFRunLoopDoSource0+81
31 CoreFoundation 0x000000010da9fcb9\uuu CFRunLoopDoSources0+185
32 CoreFoundation 0x000000010da9f29f__CFRunLoopRun+1279
33 CoreFoundation 0x000000010da9eb29 CFRunLoopRunSpecific+409
34图形服务0x00000001101af9c6 GSEventRunModal+62
35 UIKit 0x000000010a7cb9a4 UIApplicationMain+159
36用户注册示例0x00000001098deee7 main+55
37 libdyld.dylib 0x000000010ec3a621开始+1
)
libc++abi.dylib:以NSException类型的未捕获异常终止
我访问了以下链接,但没有一个解决了问题

如何删除此错误

您可以从这个链接下载代码 .

尝试按住CTRL键并从按钮拖动到下一个ViewController。然后选择“显示”。这就是你如何设置一段。然后点击segue并给他一个标识符。然后你需要设置

 performSegue(withIdentifier: String, sender: self)

您尝试过这个吗?

您链接的问题在崩溃时没有得到回答。这是您应该查找的问题=我猜您以前有一个名为
repeatPasswordTextField
的UITextField IBOutlet,您要么将其删除,要么将其重命名。但是您没有在情节提要/接口生成器中重做/撤消链接该错误可能意味着
RegisterUserServiewController
有一个名为
repeatPasswordTextField
的出口,该出口设置在情节提要中,但不在代码中。