I have two views in my App and i am having problem loading my second view when i rotate my emulator.
My first view redirects my app to second view on a button event.
When i try to rotate each view independently, it works perfect. But if i load my first view and rotate the emulator then try to load another view i am getting this :-

second view loaded as portrait where my emulator’s orientation is landscape.
But if i load my second view before rotating the emulator and then rotate it, it gets loaded perfect.
Do i need to resize my view or need to call any function to make it load properly?
i am a newbie in iOS world so any help would be highly appreciated.
Thanks.
Make sure that in your second view you use this method: