iphone - Load different xib files on Orientation in iOS -


I have created another file for another landscape mode for two .xib

I want to load the related .xib file on each rotation,

Here is my code snippet,

ViewAppDelegate.m Class << strong> border]]; ([UIApplication shared application]. Startbars Orientation == UIFrance Orientation Portrait | [UIAPCitration ShareApp] .Statsbar Orientation ==UINFterfaceArmentation PortraitUpdiddownDown) {Self Viewing Controller = [[Orientation VUIC Controller Allocon] In Whitneyname: @ "Portrait Controller" Bundle: Nile]; UINavigationController * Navigation Controller = [[UINavigationController alloc] initWithRootViewController: self.viewController]; Self.window.rootViewController = Navigation Controller; } Other {self.viewController = [[Orientation Week Controller Alok] initWithNibName: @ "Landscape Controller" bundle: zero]; UINavigationController * Navigation Controller = [[UINavigationController alloc] initWithRootViewController: self.viewController]; Self.window.rootViewController = Navigation Controller; } [Self. Windows MacKey & Wisbee]; Yes come back }

ViewController.m class

  - (zero) viewDidload {{Super Viewedload]; // Setup an additional after loading the view, usually from a nibb. } - (BOOL) must be atorotettointeraction operation: (UINTERFERSEVERATION) Interface Orientation {return yes; } - {Zero} ViewViewsAll View {if ([UIPPC Shared Sharing] .Statsbar Orientation ==UINETERFESArmentation Portrait | [UIPPC SHARING APPLICATION] STATESBARE Orientation ==UINPerfectAuthentication PortraitSupaDiddown] {[NSBindal Main Bundle] LoadNIB Nominated: @ "Portrait Controller" Owner: Self-options: Nile]; } Other {[[NSBindal main bundle] Nominated Lodnb: @ "Landscape Controller" owner: Self-choice: zero]; }}   

My app does not show anything after writing this code. It only shows the black screen

Suggest some solution.

try this type once

  [[UIDewis Current Device] is launching DeviceAnnotationNotations]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Selector (Change Orientation) Name: UIDE AppointmentDead Change Notification Object: Zero];   

To add a notification, add this method to the app view controller.

  - (zero) Change Orientation {UIDeviceOrientation orientation = [UIDevice currentDevice]. Consideration; If (Orientation == UIDivisternation Portrait || Orientation ==UIdivisOrmentation PortraitUpdidDown) {[NSBindal Main Bundle] Nominated Nominated: @ "Portrait" Owner: Self Option: Nil]; } And {[NSWindle Main Bundle] LodnIB nominated: @ "Landscape" owner: Self-choice: zero]; }}    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -