iphone Application development of the automatic landing instance operation is the content of this article, the main content is to implement automatic login instances, not much, we look at the details.
There is a uitabbarcontroller in the App, before entering the Uitabbarcontroller to verify whether the user has logged in, if not logged on will pop up a dialog box, let the user enter the login information.
Implementation method
1. In Appdelegate. H declares a variable used to bind the Uitablecontroller:
-
2, in Appdelegate. The following method is added in M
- -(void) applicationdidfinishlaunching: (uiapplication *) Application {
- Override point to customization after app launch
- [Window AddSubview:tabbarController.view];
- [Window makekeyandvisible];}
- Background image
- window.backgroundcolor = [uicolor colorwithpatternimage: [uiimage imagenamed:@" Wallpaper.png "]];
- [uiapplication sharedapplication] .statusbarhidden  =  no ;
- If you are not logged in, do the following:
- Loginviewcontroller * Login = [[Loginviewcontrolleralloc] initwithnibname:@ "Loginviewcontroller" Bundle:
- [Nsbundlemainbundle]]; Uinavigationcontroller *nav = [[Uinavigationcontrolleralloc] initwithrootviewcontroller:login];
- [Self.tabbarControllersetModalTransitionStyle:UIModalTransitionStyleCoverVertical];
- [Self.tabbarControllerpresentModalViewController:nav Animated:yes];
3, in the pop-up view of the login execution method, the following method is executed last
- -(ibaction) login
- {
- NSLog (@ "Login Press");
- [Selfdismissmodalviewcontrolleranimated:yes];
- }
Automatic landing instance operation for iphone application development