开发者

go back to main view

开发者 https://www.devze.com 2023-03-01 08:12 出处:网络
Hello I have a main 开发者_如何学运维view and I add another view with add subview. Then I add and 3rd view with add subview. Now I want to go back on the main view. How will I do that?

Hello I have a main 开发者_如何学运维view and I add another view with add subview. Then I add and 3rd view with add subview. Now I want to go back on the main view. How will I do that? (I cant use addsubview:view or _view)


I'm not exactely sure what you mean by "going back" to the mainview, but you can send messages to your superview via delegation. Just set a delegate in your subview and set it to self upon adding it as a subview and releasing it.

If by "going back" you mean removing all subviews, then just call -removeFromSuperview from every subview and you should be fine :)

0

精彩评论

暂无评论...
验证码 换一张
取 消