Reputation: 157
Hello I am calling a NSNotificationCenter whenever I am getting a notification in my application. I knew one that in order to make NSNotificationCenter to work we have to add it first and then we have to call it. I am already doing this thing in my Home Class. In order to notifications to work a user has to Login first. After Login it will go to Home screen where I am adding observer for NSNotificationCenter.
My concept is that when ever my App is in active state then for that I am showing a custom NotificationPopUp.
The problem I'm facing is when I switch class say I go to profile class from Home Class then for some reason my NSNotificationCenter is not getting called. I am not removing observer for the same NSNotificationCenter anywhere in my class. And when I come back to the same Home class again then my NSNotificationCenter is getting called and customNotiPopUp is showing. I really don't know what is the problem I am facing as I am not using remove observer for the same.
I am using SWREveal Controller as a SideMenuoption for navigation to different classes. Is this thing creating problem? Any help will be appreciated.
Upvotes: 0
Views: 40
Reputation: 157
Yeah I have solved the problem. Actually I am taking a baseclass for every class and in that I have added the observer now it's working perfect as expected. It was a silly mistake by me.
Upvotes: 0