【发布时间】:2017-11-18 17:43:38
【问题描述】:
您好,我在我的应用程序中使用reveal view Controller。它在所有情况下都可以正常工作。问题是在调用通知时。我的reveal view 中有 6 个前视图控制器。在所有view controllers 中,我声明了一个同名的通知。我从SWrevealViewController.m 文件中调用了这个通知。现在在所有视图控制器中调用通知操作。实际上,仅当视图控制器处于活动状态或它位于活动视图控制器的后面时才会调用通知。
如果我至少打开一次剩余的视图控制器,就会出现问题。如果我没有打开它们,则不会在该视图控制器中调用通知。
【问题讨论】:
-
你的问题不清楚我不明白
Actually notifications called only if view controllers in active state or it is in back of active view controllers. Issue comes if I opened remaining view controllers at least once. If I didn't open them then notification not called in that view controller -
好的。在右边的桌子上,我有工作、卡片、个人资料、地址。如果我选择 job ,将显示作业视图控制器。我在所有 4 个视图控制器中声明了通知。一旦我显示了所有四个视图控制器。现在我终于进入了工作屏幕。现在我从 Reveal 视图中调用了通知,然后通知只需要在作业视图中触发。但它调用了所有 4 个视图。@Anbu
-
简单,能不能把你的notification addobserver,postnotification 及相关代码展示出来
-
显示您的代码,说明您如何在所有视图中声明通知!
标签: ios objective-c swrevealviewcontroller nsnotifications