NewInterfaceReplacement.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // NewInterfaceReplacement.m
  3. // MingMen
  4. //
  5. // Created by 罗云飞 on 2017/5/19.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "NewInterfaceReplacement.h"
  9. @implementation NewInterfaceReplacement
  10. static NewInterfaceReplacement *sharedObj = nil;
  11. + (instancetype)sharedInstance
  12. {
  13. static dispatch_once_t onceToken = 0;
  14. dispatch_once(&onceToken, ^{
  15. sharedObj = [[super allocWithZone: NULL] init];
  16. });
  17. return sharedObj;
  18. }
  19. + (id) allocWithZone:(struct _NSZone *)zone
  20. {
  21. return [self sharedInstance];
  22. }
  23. - (id) copyWithZone:(NSZone *) zone
  24. {
  25. return self;
  26. }
  27. - (void)replacementLogin
  28. {
  29. //退出云信账号、解绑阿里云推送账号、删除用户单例类以及本地缓存保存的数据
  30. [UserHelper ExitLogin];
  31. //销毁之前的单利对象
  32. [NewBasicTabbarController objectDealloc];
  33. //跳转登录界面
  34. NewLoginViewController *startVc = [[NewLoginViewController alloc] init];
  35. UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:startVc];
  36. [AppDelegate shareDelegate].window.rootViewController = navi;
  37. }
  38. - (void)replacementController
  39. {
  40. //进入程序主控制界面
  41. [[AppDelegate shareDelegate].window setRootViewController:[NewBasicTabbarController sharedInstance]];
  42. }
  43. @end