Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singleton instance already exists. #45

Closed
klinkert0728 opened this issue May 22, 2014 · 4 comments
Closed

Singleton instance already exists. #45

klinkert0728 opened this issue May 22, 2014 · 4 comments

Comments

@klinkert0728
Copy link

I have a logout button, when i press this button the user should log in again, when the user log in correctly this message appears
"Singleton instance already exists. You can only instantiate one instance of SlideNavigationController. This could cause major issues".

I know why that's happen but i don't know how to remove the slideNavigationCntroller instance when the user press Logout

Hope you can help me

@aryaxt
Copy link
Owner

aryaxt commented May 23, 2014

That log means it's assigning the newly created SlideNavigationController to the singleton instance which is already assigned to one. As long as that's what you mean to do it's fine. It's more like a warning.

I personally never kill the login page. I keep it as the first item in the stack, and when signing out is selected i just pop to rootViewController. The demo project does exactly that.

Unfortunately I haven't found any better way to manage a singleton instance in a way that works both in code and storyboard. The reason SlideNavigationController is a singleton is so that you are able to reference it when it's created using initWithCoder, also to be able to easily access it from animator classes and the menuViewController.

I'll probably add a more meaningful message for that in the next version to avoid any confusion.

@klinkert0728
Copy link
Author

Ok Thank you very much for your explanation, I will take your advice not to kill the login page. it's an amazing controller thank you very much for your support.

@aryaxt
Copy link
Owner

aryaxt commented May 23, 2014

Just a TLDR & Summary for future reference:

To avoid that warning have SlideNavigationController as the starting point of your storyboard.

@aryaxt aryaxt closed this as completed May 29, 2014
@prabhums
Copy link

Im still seeing this warning message. Is there any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants