Let's say I add a new view to my UIWindow
[windowRoot addSubview:MyNewView.view];
Is it possible to get the name of this view later if I have a link to windowRoot? Sort of:
[windowRoot getCurrentViewName]
thank
UIWindow there is a UIView, so you can do something like this to get it as subviews:
UIWindow
UIView
for (UIView *view in windowRoot.subviews) { NSLog(@"View: %@", view); }
Your question seems to imply a big design problem. I assume that "name" means the name of the variable related to the new view? This variable should actually be an instance variable of your window controller.
NSUserDefaults *savedData = [NSUserDefaults standardUserDefaults]; NSString *currentPage = [NSString stringWithFormat:@"%@", self.nibName]; [savedData setObject:currentPage forKey:@"lastViewAccessed"]; //self.nibName will get you what you the name of the view.
Source: https://habr.com/ru/post/1741666/More articles:Rollback to a specific point using PostgreSQL - postgresqlHow cookies are processed if you use a proxy server between the client and server in HTTP - cookiesUnable to create MVC project in VS2010 - visual-studio-2010jquery.not () filter - jqueryNo Symfony Form Values - formsDatabase schema for multiple category / product relationships - phpSelect only visible text fields in jQuery - jqueryМетоды расширения в проекте библиотеки классов - c#Text encoding in HTML text fields - htmlWhich model is good for a bullet hit test in a game that requires server verification? - javaAll Articles