我有一个storyboard
。
在此storyboard
有一个UITableViewController
它使用自定义类 comMasterViewController。
使用storyboard
,我只需从 UITableViewController
按住 Control 键拖动即可到另一个场景。
模态 segue
被 build 。我将其标识符更改为“loadingDataSegue”。
在我的UITableViewController
代码,我触发这一行:
[self performSegueWithIdentifier:@"loadingDataSegue" sender:nil];
我收到:
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'Receiver (<comMasterViewController: 0x1b6290>) has no segue with
identifier 'loadingDataSegue''
什么地方没有正确连接?
感谢您的帮助
编辑: 我很确定我链接的是 TVC,而不是任何 subview 。查看 Storyboard代码,我看到以下内容:
<tableViewController storyboardIdentifier="comMasterViewController"
title="comMasterViewController" clearsSelectionOnViewWillAppear="NO" id="19"
userLabel="comMasterViewController" customClass="comMasterViewController"
sceneMemberID="viewController">
在底部,作为 <tableViewController>
的子标签而不是它的任何 subview :
<connections>
<segue destination="UCh-sM-lba" kind="modal" identifier="loadingDataSegue"
id="epP-jH-GLZ"/>
</connections>
这是堆栈跟踪:
0 CoreFoundation
0x363388a7 __exceptionPreprocess + 186
1 libobjc.A.dylib
0x3758d259 objc_exception_throw + 32
2 UIKit
0x31193a3f -[UIViewController performSegueWithIdentifier:sender:] + 154
3 EZSystem
0x000bdfe7 -[comMasterViewController insertNewObject:] + 58
4 CoreFoundation
0x362923fd -[NSObject performSelector:withObject:withObject:] + 52
5 UIKit
0x30fc8faf -[UIApplication sendAction:to:from:forEvent:] + 62
6 UIKit
0x3108e76b -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 118
7 CoreFoundation
0x362923fd -[NSObject performSelector:withObject:withObject:] + 52
8 UIKit
0x30fc8faf -[UIApplication sendAction:to:from:forEvent:] + 62
9 UIKit
0x30fc8f6b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
10 UIKit
0x30fc8f49 -[UIControl sendAction:to:forEvent:] + 44
11 UIKit
0x30fc8cb9 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 492
12 UIKit
0x30fc95f1 -[UIControl touchesEnded:withEvent:] + 476
13 UIKit
0x30fc7ad3 -[UIWindow _sendTouchesForEvent:] + 318
14 UIKit
0x30fc74c1 -[UIWindow sendEvent:] + 380
15 UIKit
0x30fad83d -[UIApplication sendEvent:] + 356
16 UIKit
0x30fad0e3 _UIApplicationHandleEvent + 5826
17 GraphicsServices
0x3264f22b PurpleEventCallback + 882
18 CoreFoundation
0x3630c523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
19 CoreFoundation
0x3630c4c5 __CFRunLoopDoSource1 + 140
20 CoreFoundation
0x3630b313 __CFRunLoopRun + 1370
21 CoreFoundation
0x3628e4a5 CFRunLoopRunSpecific + 300
22 CoreFoundation
0x3628e36d CFRunLoopRunInMode + 104
23 GraphicsServices
0x3264e439 GSEventRunModal + 136
24 UIKit
0x30fdbe7d UIApplicationMain + 1080
25 EZSystem
0x0009f963 main + 86
26 EZSystem
0x0009f908 start + 40
这是一张图片:
最佳答案
确保您没有从 TableView Row 或 UIButton 中拖动 Segue,而是从 VC 本身中拖动。如果您有疑问,请删除 segue 并重新连接。如果这不能解决您的问题,还要检查拼写错误(包括大小写)。
关于objective-c - 射击失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9985496/