作者:劳资就是若听_979 | 来源:互联网 | 2023-08-27 13:46
Ihave3viewControllers:我有3个viewControllers:VcA:Ireaddatawithobserversfromdatabaseandpa
I have 3 viewControllers:
我有3个viewControllers:
VcA: I read data with observers from database and pass with segue to VcB.
VcA:我从数据库的观察者那里读取数据,然后用segue传递给VcB。
VcB: I read data and display it, with a button I call VcC to update data passing datas with segue.
VcB:我读取数据并显示它,我用一个按钮调用VcC来更新使用segue传递数据的数据。
VcC: a STATIC tableview in wich I update data and save them.
VcC:STATIC tableview,我更新数据并保存。
The problem is that when I dismiss after saved VcC and go back in VcB all data is old, even if in firebase all datas are perfectly updated.
问题是,当我在保存的VcC之后解雇并返回VcB时,所有数据都是旧的,即使在firebase中所有数据都已完全更新。
In VcB for example I read the Title like this:
以VcB为例,我读了这样的标题:
var groupName: String?
than in didAppear:
比在didAppear:
Name.title = groupName
Anyway if I also go back from VcB to VcC all data of the table are the old data.
无论如何,如果我也从VcB返回到VcC,那么该表的所有数据都是旧数据。
To be more clear:
更清楚:
I call the database in VcA
我在VcA中调用数据库
click the name in the table and pass the data to Vcb, all is fine for now, title and other vars are ok
单击表中的名称并将数据传递给Vcb,现在一切正常,标题和其他变量都可以
now I click EDIT and call to VcC, the table where I update the data, make change and save,
现在我单击EDIT并调用VcC,我更新数据的表,进行更改并保存,
after save VcC dismiss and I go back to VcB -> title is still p2 but in firebase not!
保存VcC解雇后我回到VcB - >标题仍然是p2但是在firebase中没有!
I click again on EDIT to return to VcC (the edit table), title is the old one
我再次点击EDIT返回VcC(编辑表),标题是旧的
I think that I have to recall datas from db... anyway to do it without refresh the data from firebase?
我想我必须从数据库中调用数据...无论如何要做到这一点而不刷新firebase的数据?
I know that if I go back to VcA after save all is fine but I really need to go to VcB, how can I do?
我知道如果我在保存之后回到VcA一切都很好,但我真的需要去VcB,我该怎么办?
I found many threads, this is the most similar but not exact situation... Reload tableView after dismiss a viewController
我找到了很多线程,这是最相似但不确切的情况......在解除viewController后重新加载tableView
1 个解决方案