To view1 I added a sub view (view2). And now I am in view2, Now I wanted to move back to view1. I am using [self.view removefromsuperview] but it is not working.
To view1 I added a sub view (view2). And now I am in view2,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You aren’t supposed to organise your application as views that you add on top of one another. A more typical way of organising your application is to split the different screens into different view controllers and use a
UINavigationControllerto navigate between them.If you just lump all your code together into a single view controller and manually add and remove views, you’re going to get into a mess very quickly. I strongly recommend reading View Controller Programming Guide for iOS.