Is there a list of names that you can use with NSNotificationCenter?

Let me start with my question and then explain what I'm trying to do if people don't understand the question.

I want to use the Action Center to catch the event from the UITabBarController. I am trying to detect when a tab was changed. In the documentation, I see that I can get this event if I use a delegate. However, I have two separate view controllers in my TabBarController and they need to know if they are active. Is there a way to know if the corresponding event is sending a notification? Should I create my own delegate and send the notification myself?

It all started when I decided that my program should have a different view depending on the orientation. I wrote my program to have a tab bar at the top level with two tabs. The first is the program, the other is the "about" window. When I rotate the device, I need the view to change in the first tab and in the second tab. I managed to get this to work by listening to device notifications that alert you when a device is rotated. Then I change the view in the controller based on the orientation. The problem I see is that both controllers are receiving these notifications and I haven't found a way to keep the unselected tab from receiving such notifications anymore. My idea was to listen to which tab was selected and then remove the other from the rotation notifications.It doesn't work yet.

So, I have no idea if this makes any sense, but curious to see what people are saying and suggesting.

Summary: How do I know what notifications are available? Should I create a delegate and disable my own notifications? Is there a better way to change your view of the turn?

+1


source to share


1 answer


You can find the UIApplication notices here .

Alternatively, you can use darwin notifications which you can find here and you can find an example of using darwin notifications.



Also, don't forget that in the Apple documentation, you can always check if a particular class (e.g. class for example - scroll down) has notifications that you can register (e.g. UIApplication example).

Good luck.

0


source







All Articles