如何在当前视图控制器中重新加载另一个uiviewcontroller的tableview
请帮帮我。如果它重复,我感到非常抱歉,但我没有得到所需的答案,这就是我再次询问的原因。
我想在第一个视图中重新加载另一个视图的表。
提前致谢。
Please help me out. I am very sorry if it is duplicate but i didn't get required answer that is why i am asking again.
I want to reload table of anotherview in my first view.
Thanks in adavance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在第一个 viewcontroller.m 中,我将其放入
viewDidLoad
方法中:在第二个 viewcontroller.m 中:
In the first viewcontroller.m, I put this in the
viewDidLoad
method:In the second viewcontroller.m:
使用
nonatomic
和retain
为UITableview
创建属性..(视图控制器1)在视图控制器 2 中创建视图控制器 1 的对象。
现在在 viewcontroller 1 对象的帮助下您可以访问它。
示例:
在 ViewController2 .m 文件中:
Create property for
UITableview
withnonatomic
andretain
.. (view controller 1)in View Controller 2 create object of viewcontroller 1.
now with help of viewcontroller 1 object you can access it.
Example:
In ViewController2 .m file:
按以下方式执行:
假设您有 2 个视图控制器。
ViewController1
ViewController2
并且您在
ViewController2
中有UITableView
对象tblTable
。在
ViewController2.h
文件中:在
ViewController2.m
文件中:现在在
ViewController1.m
文件中:我希望它对您有所帮助。
如有任何困难请告诉我。
干杯。
Do it in below way:
Suppose you have 2 view controller.
ViewController1
ViewController2
And you have
UITableView
objecttblTable
inViewController2
.in
ViewController2.h
file:in
ViewController2.m
file:Now in in
ViewController1.m
file:I hope it will be helpful to you.
Let me know in case of any difficulty.
Cheers.
我有类似的问题,我正在使用故事板,这就是我解决它的方法。假设您想从 ViewController1 中的函数重新加载 ViewController2 中的表。执行以下操作:
现在将此代码放入您想要重新加载的函数或任何按钮操作中
I had similar issue and I was using storyboard this is how I fixed it. Suppose u want to reload the table which is in ViewController2 from a function in ViewController1. Do the following:
Now put this code in the function or any button action under which u want to reload