views:

372

answers:

2

I have a uiview class and i want to switch to other uiview class but without using addsubview is there any other way to do that except the one (addSubView)

A: 

If you have UIViewControllers for the corresponding UIViews, and have a UINavigationController to handle your view flow, you can use pushViewController message at the mentioned navigation controller.

Pablo Santa Cruz
yes i know that but i dont have any uiviewcontroller.... i just have uiview and i want it to switch to other uiview but without using addSubview....
yunas
You do "i have a uiviewcontroller class that has a nib" and then you don't. Which is it? You will have to post your code.
falconcreek
dear falconcreek i have done something similar as u r guiding and i am done with my assignment, but; what actually i was trying to acquire was, is there any other way to switch to some UIVIEW from and UIVIEW without using addSubview....
yunas
A: 

Since you have a navigation controller you can use pushViewController:animated to add anotherViewController to the navigation stack. You can also use presentModalViewController:animated. The section on Navigation Controllers in View Controller Programming Guide explains this very well.

falconcreek