Automatic landing instance operation for iphone application development

Source: Internet
Author: User

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

  
 
  1. -(void) applicationdidfinishlaunching: (uiapplication *) Application {
  2. Override point to customization after app launch
  3. [Window AddSubview:tabbarController.view];
  4. [Window makekeyandvisible];}
  5. Background image
  6. window.backgroundcolor  = [uicolor colorwithpatternimage: [uiimage imagenamed:@" Wallpaper.png "]];    
  7.     [uiapplication sharedapplication] .statusbarhidden  =  no ;    
  8. If you are not logged in, do the following:
  9. Loginviewcontroller * Login = [[Loginviewcontrolleralloc] initwithnibname:@ "Loginviewcontroller" Bundle:
  10. [Nsbundlemainbundle]];    Uinavigationcontroller *nav = [[Uinavigationcontrolleralloc] initwithrootviewcontroller:login];
  11. [Self.tabbarControllersetModalTransitionStyle:UIModalTransitionStyleCoverVertical];
  12. [Self.tabbarControllerpresentModalViewController:nav Animated:yes];

3, in the pop-up view of the login execution method, the following method is executed last

  
 
  1. -(ibaction) login
  2. {
  3. NSLog (@ "Login Press");
  4. [Selfdismissmodalviewcontrolleranimated:yes];
  5. }

Automatic landing instance operation for iphone application development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.