ios - 导航回父场景时展开 segue 问题
<p><p>我正在尝试从场景中解脱出来。它工作正常,但我需要为父屏幕获取一个值。 (我使用 push segue 从父场景导航到子场景)</p>
<p>我是这样称呼放松转场</p>
<pre><code>- (IBAction)done:(UIStoryboardSegue *)segue {
NSLog(@"gonna navigate");
RESTToppingTableViewController *vc = ;
];
NSLog(@"%@", );
}
</code></pre>
<p>但问题是,似乎 <code>toppingList</code> 数组甚至在调用父 View 之前就已从内存中删除。</p>
<p>以下是我得到的错误。</p>
<pre><code>2013-12-06 13:26:42.192 Pizza to Go *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-: unrecognized selector sent to instance 0x9b681a0'
*** First throw call stack:
(
0 CoreFoundation 0x01f405e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01cc38b6 objc_exception_throw + 44
2 CoreFoundation 0x01fdd903 - + 275
3 CoreFoundation 0x01f3090b ___forwarding___ + 1019
4 CoreFoundation 0x01f304ee _CF_forwarding_prep_0 + 14
5 Pizza to Go 0x0004a3a2 - + 130
6 libobjc.A.dylib 0x01cd581f - + 70
7 UIKit 0x010d01f1 - + 536
8 UIKit 0x00f660f9 - + 115
9 libobjc.A.dylib 0x01cd5874 - + 77
10UIKit 0x00a330c2 - + 108
11UIKit 0x00d07c9b - + 139
12libobjc.A.dylib 0x01cd5874 - + 77
13UIKit 0x00a330c2 - + 108
14UIKit 0x00a3304e - + 61
15UIKit 0x00b2b0c1 - + 66
16UIKit 0x00b2b484 - + 577
17UIKit 0x00b2a733 - + 641
18UIKit 0x00a7051d - + 852
19UIKit 0x00a71184 - + 1232
20UIKit 0x00a44e86 - + 242
21UIKit 0x00a2f18f _UIApplicationHandleEventQueue + 11421
22CoreFoundation 0x01ec983f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
23CoreFoundation 0x01ec91cb __CFRunLoopDoSources0 + 235
24CoreFoundation 0x01ee629e __CFRunLoopRun + 910
25CoreFoundation 0x01ee5ac3 CFRunLoopRunSpecific + 467
26CoreFoundation 0x01ee58db CFRunLoopRunInMode + 123
27GraphicsServices 0x03e159e2 GSEventRunModal + 192
28GraphicsServices 0x03e15809 GSEventRun + 104
29UIKit 0x00a31d3b UIApplicationMain + 1225
30Pizza to Go 0x000574ad main + 141
31libdyld.dylib 0x0285e725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
</code></pre>
<p>可能的解决方法是什么?提前感谢您的宝贵时间。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我不确定,但我认为您的 <code>destinationViewController</code> 不是 <code>RESTToppingTableViewController</code>。</p>
<p>日志:</p>
<pre><code>-:
unrecognized selector sent to instance 0x9b681a0
</code></pre>
<p>表示您正在尝试获取 <code>RESTAddToCartViewController</code> 的 toppingList,但此 Controller 没有 toppingList 属性。</p>
<p>确保 <code></code> 返回的 <code>UIViewController</code> 确实是您所期望的。</p></p>
<p style="font-size: 20px;">关于ios - 导航回父场景时展开 segue 问题,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/20418923/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/20418923/
</a>
</p>
页:
[1]