gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:07:11 25 4
gpt4 key购买 nike

我尝试从表中获取单元格的文本(在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com