ios - 错误 : "nested pop animation can result in corrupted navigation bar"

标签 ios objective-c iphone

我尝试从表中获取单元格的文本(在 ViewController B 中)并将其显示在 textView 中(在 ViewController A 中)。第一次一切都很好,但是第二次在控制台中出现错误消息: “嵌套的弹出动画会导致损坏的导航栏 在意外状态下完成导航转换。导航栏 subview 树可能会损坏。”

我的代码是: 在 ViewController B 中

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Retrieve the value of cell selected
self.valeurCell = [NSString stringWithFormat:@"%@", [tableView cellForRowAtIndexPath:indexPath].textLabel.text];

// Send the value of cell in the answer area (class: SendMessagesViewController)
[[NSNotificationCenter defaultCenter] postNotificationName:@"notice" object:self.valeurCell];

在 ViewController A 中 (viewDidLoad)

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dataTransfer:) name:@"notice" object:nil];


-(void) dataTransfer:(NSNotification *) sentObject{

// !!! en test !!!
self.textViewMsg.text = (NSString *) [sentObject object] ;
[self.navigationController popViewControllerAnimated:YES];

谢谢

最佳答案

viewDidAppear 之前弹出或推送 ViewController 是不安全的。执行这段代码 [self.navigationController popViewControllerAnimated:YES];在调用 viewDidAppear() 之后。

关于ios - 错误 : "nested pop animation can result in corrupted navigation bar",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25728002/

相关文章:

iPhone UIWebView - 调用 loadHTMLString :baseURL: a second time doesn't do anything?

ios - awakeFromNib 未在自定义单元格类中调用,因为 IBOutlets 为零

ios - 如何在 NSMutableArray 中使用循环在任何索引处获取对象

iphone - 在界面旋转时对 UIView 到底做了什么?

ios - Storyboard中的 UITableView 标题高度不会改变

iphone - 有没有使用 GData API 将视频上传到 youtube iOS 应用程序的教程?

iphone - @synthesize IBOutlet 属性

ios - 如何获得 CurrentCulture 的正确值?

iphone - UIView 内部的 UIScrollView

ios - 崩溃,终止原因 0xdead10cc