objective c - addSubView not working, attempting to switch views -


// viewcontroller.m

1: - (ibaction)done:(id)sender { 2: 3:     [self.view removefromsuperview]; 4:     [self.view addsubview:masterviewcontroller]; 4: } 

error on line 4: "unexpected interface name masterviewcontroller :expected expression". have 2 view controllers: viewcontroller , masterviewcontroller. i've set first view viewcontroller i'm trying button change view.

you can move first oneviewcontroller anotherviewcontroller using this.

- (ibaction)buttonpressed:(id)sender {     masterviewcontroller *createusercontroller = [[masterviewcontroller alloc] initwithnibname:@"masterviewcontroller" bundle:[nsbundle mainbundle] keywrapper:keychainwrapper];     [self presentviewcontroller:createusercontroller animated:yes completion:nil]; } 

and if using uinavigationviewcontroller can push viewcontroller like

[self.navigationcontroller pushviewcontroller:createusercontroller  animated:yes]; 

and using

[self.navigationcontroller popviewcontroller:createusercontroller animated:yes]; 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -