Version judgment:
1. First you need to know this key value pair of Key:id key = (id) kcfbundleversionkey;
2. Get the current version number with the local nsbundle.
3. Obtain the corresponding version number in the sandbox.
4. Compare to determine the loading situation.
//get the current version first, get it from plist//find the current corresponding version in the bundle IDKey = (ID) Kcfbundleversionkey; Nsdictionary*infodictionary=[NSBundle mainbundle].infodictionary; NSString*currentversion =[Infodictionary Objectforkey:key]; //bundles obtained from the sandboxNsuserdefaults *defaults=[Nsuserdefaults Standarduserdefaults]; NSString*defaultversion =[Defaults Objectforkey:key]; if([defaultversion isequal:currentversion]) {Self.window.rootViewController=[[Csmainbarcontroller alloc]init]; }Else{Cslaunchview*indexview =[[Cslaunchview alloc]init]; Self.window.rootViewController=Indexview; }
1. Create a new class to load the corresponding picture. The Uiscrollview is then set on a view through the Uivivecontroller.
2. Load the corresponding view
3. Load the corresponding Pagecontroller
////cslaunchview.m//Diary////Created by asheng123 on 15/4/13.//Copyright (c) 2015 asheng123. All rights reserved.//#import "CSLaunchView.h"#defineLaunchimage 4@interfaceCslaunchview () <UIScrollViewDelegate>@property (nonatomic,weak) Uipagecontrol*MyPage;@end@implementationCslaunchview-(void) viewdidload{//Some information about loading the corresponding ScrollView[self loadscrollview]; //Load a Pagecontrol[self Loadpagecontrol];}-(void) loadpagecontrol{Uipagecontrol*pagecontrol=[[Uipagecontrol alloc]init]; Self.mypage=Pagecontrol; Pagecontrol.numberofpages=Launchimage; Pagecontrol.x= self.view.size.width*0.5; Pagecontrol.y= Self.view.size.height- -; Pagecontrol.pageindicatortintcolor=[Uicolor Graycolor]; Pagecontrol.currentpageindicatortintcolor=[Uicolor Blackcolor]; [Self.view Addsubview:pagecontrol];}-(void) loadscrollview{//Create a ScorllviewUiscrollview *thescorll=[[Uiscrollview alloc]init]; //set the corresponding sizeThescorll.frame =Self.view.bounds; Thescorll.Delegate=Self ; CGFloat Imagew=TheScorll.frame.size.width; CGFloat Imageh=TheScorll.frame.size.height; [Self.view Addsubview:thescorll]; for(inti =0; i<launchimage; i++) {//UIImage *name=[uiimage imagenamed: [NSString stringwithformat:@ "new_feature_%d", I+1]];NSString *name = [NSString stringWithFormat:@"new_feature_%d", i+1]; if(phoneinch) {[Name stringbyappendingstring:@"@2x"]; } Uiimageview*theimage =[[Uiimageview alloc]initwithimage:[uiimage Imagenamed:name]]; [Thescorll Addsubview:theimage]; Theimage.x= imagew*i; NSLog (@"thescorll width is%f", Thescorll.width); Theimage.y=0; Theimage.width=Imagew; Theimage.height=Imageh; } thescorll.contentsize= Cgsizemake (Launchimage *self.view.width,0); Thescorll.pagingenabled=YES; Thescorll.bounces=NO; Thescorll.showshorizontalscrollindicator=NO;}-(void) Scrollviewdidscroll: (Uiscrollview *) scrollview{cgfloat num= (Scrollview.contentoffset.x/self.view.width); intIntpage = (int) (num +0.5); Self.mypage.currentPage=intpage;}@end
Today's word: mechanism
Underpin
Notion
Encapsulates
Corresponds
Conform
Conventions
lowercase
Sequence
Traverse
Glance
observes
Inform
Illustration
Scenario
Establishes
Invoked
Compliant
Scheme
Infrastructure
Compliant
Demonstrates
Emits
Bitwise
An Inspector object
Maintain
Triggered
Proxy
Manual
Granular
Control
Nest
Fragment
Derived property
iOS boot loading boot pictures