我可以观察UIViewController何时更改UIViewcontroller

时间:2017-03-27 07:01:50

标签: ios objective-c iphone uiviewcontroller nsnotificationcenter

我需要创建一个观察者,只要UIViewcontroller被更改就会调用它 如何在委托或单个方法中使用它来观察UIViewcontroller更改中的完整层次结构更改?

[[NSNotificationCenter defaultCenter] addObserver:self // put here the view controller which has to be notified
                                         selector:@selector(viewcontrollerChanged:)
                                             name:@"UIDeviceOrientationDidChangeNotification" 
                                           object:nil];

0 个答案:

没有答案