我的解决方案:...

1、在appdelegate.m中找到

“application:didFinishLaunchingWithOptions:”方法, 添加以下代码:

/**

*      前导页

*/

if([[[NSUserDefaults standardUserDefaults] objectForKey:@"isExisted"]isEqualToString:@"exist"]){

[self gotoMain];

NSLog(@"222222222");

}else{

FirstLaunchViewController *firstLaunchVC = [[FirstLaunchViewController alloc]init];

self.window.rootViewController = firstLaunchVC;

NSLog(@"111111111");

}

-(void)gotoMain

{

NSLog(@"主页。。。");

[[NSUserDefaults standardUserDefaults] setObject:@"exist" forKey:@"isExisted"];

MainViewController *firstLaunchVC = [[MainViewController alloc]init];

self.window.rootViewController = firstLaunchVC;

NSLog(@"111111111");

}

总的解决办法是 key: @”isExisted” 对应的value 是不是“exist”判断用户以前是否登录,

第一次启动的时候 key @” isExisted” 不会被赋址的, 也就是说value为nil.

2、前导页

新建FirstLaunchViewController文件,走完前导页,调用的APPDelegate.h方法进入主页界面。。。

#import "JYEFirstLaunchViewController.h"

#import "AppDelegate.h"

@interface FirstLaunchViewController ()<UIScrollViewDelegate>

{

UIPageControl * pageCtr;

BOOL isOut;//判断是否进入主页

}

@end

@implementation JYEFirstLaunchViewController

- (void)viewDidLoad {

[super viewDidLoad];

// Do any additional setup after loading the view.

[self gotoLaunchView];

}

-(void)gotoLaunchView

{

NSLog(@"引导页");

UIScrollView * scroll = [[UIScrollView alloc]initWithFrame:[UIScreen mainScreen].bounds];

scroll.pagingEnabled = YES;

scroll.delegate = self;

scroll.contentOffset = CGPointMake(0, 0);

scroll.contentSize = CGSizeMake(self.view.frame.size.width * 3, self.view.frame.size.height);

//    scroll.bounces = NO;//让scrollView在他的自身范围内滑动//在这里添加“进入应用Button”

[self.view addSubview:scroll];

NSArray * imageArr = @[@"Default1@2x.png",@"Default2@2x.png",@"Default3@2x.png"];

for(int i = 0;i<imageArr.count;i++)

{

UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width * i, 0, self.view.frame.size.width, self.view.frame.size.height)];

imageView.image = [UIImage imageNamed:imageArr[i]];

[scroll addSubview:imageView];

}

pageCtr = [[UIPageControl alloc]initWithFrame:CGRectMake(50, scroll.frame.size.height - 30, scroll.frame.size.width - 100, 30)];

pageCtr.currentPage = 0;

pageCtr.numberOfPages = imageArr.count;

pageCtr.pageIndicatorTintColor = [UIColor redColor];

[self.view addSubview:pageCtr];

}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView

{

if(scrollView.contentOffset.x > self.view.frame.size.width * 2)

{

//跳到主界面

isOut = YES;

}

}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

{

pageCtr.currentPage = scrollView.contentOffset.x / self.view.frame.size.width;

if(isOut)

{

[UIView animateWithDuration:0.1 animations:^{

scrollView.alpha = 0;

} completion:^(BOOL finished) {

[scrollView removeFromSuperview];

[self gotoMain1];

}];

}

}

-(void)gotoMain1{

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

[appDelegate gotoMain];

NSLog(@"zhuye");

}

判断是否是 首次 进入app,,以及Xcode7之后前导页的设置的更多相关文章

  1. iOS 10 的坑:新机首次安装 app,请求网络权限“是否允许使用数据”(转)

    症状 iOS 10 之后,陆陆续续地有用户联系我们,说新机第一次安装.第一次启动的时候,app 首屏一片空白,完全没数据.kill 掉重新打开就好了. 一开始以为是用户网络情况不好,但随着越来越多的用 ...

  2. 首次发布App,In-App Purchase 无法submit for review 问题的解决方案

    原地址:http://blog.csdn.net/blucenong/article/details/7819195 一个IDP首次create app 然后首次create new IAP的时候,我 ...

  3. 判断是苹果还是安卓app联调

    //app苹果联调 function iosReload(){ //window.webkit.messageHandlers.signUpSuccess.postMessage(null); } / ...

  4. android 判断程序是首次(第一次)进入

    很多时候,我们需要判断用户是不是第一次进入程序,以决定是不是给用户一些操作提示. 这种功能的实现,说到底还是将数据(一个标志位)存储起来,下次进入程序的时候读取数据进行判断. 我这里只给出一种较简单的 ...

  5. HTML中判断手机是否安装某APP,跳转或下载该应用

    有些时候在做前端输出的时候,需要和app的做些对接工作.就是在手机浏览器中下载某app时,能判断该用户是否安装了该应用.如果安装了该应用,就直接打开该应用:如果没有安装该应用,就下载该应用.那么下面就 ...

  6. js判断是否安装某个android app,没有安装下载该应用(websocket通信,监听窗口失去焦点事件)

    现在经常有写场景需要提示用户下载app, 但是如果用户已经安装,我们希望是直接打开app. 实际上,js是没有判断app是否已经安装的方法的,我们只能曲线救国. 首先,我们需要有call起app的sc ...

  7. iOS 之 判断是否是第一次打开app

    /** App判断第一次启动的方法 */ NSString *key = @"isFirst"; BOOL isFirst = [[NSUserDefaults standardU ...

  8. js判断设备,跳转app应用、android市场或者AppStore

    js移动设备判断方法大全 <!DOCTYPE html> <html> <head> <meta charset="UTF-8" > ...

  9. APP发布Xcode7

    一.准备工作 1>准备3.5寸.4寸.4.7寸.5.5寸的程序截图至少个1张,如果支持iPad,那么iPad截图也要有.这些截图尽量截取页面漂亮的,因为这些截图是要放在AppStore中展示的. ...

随机推荐

  1. 命令模式坚决svn树冲突(local unversioned, incoming add upon update)

    当工作目录修改删除过时更新使用svn更新就容易发生树冲突“Tree Confilict”.会出现类似提示. local unversioned, incoming add upon update 如果 ...

  2. CodeForces 450B (矩阵快速幂模板题+负数取模)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=51919 题目大意:斐波那契数列推导.给定前f1,f2,推出指定第N ...

  3. 关于 Apple Metal API 的一些想法

    在看完 Metal 的开发文档后,除了官方所宣称的一些优点外(比如说更容易理解和使用的 API,更直接和精细的硬件控制,减少 GPU 使用过程中的 CPU 额外开销等等),从我有限的 GLES 开发经 ...

  4. access-Control-Allow-Origin跨域请求安全隐患

    最新的W3C标准里是这么实现HTTP跨域请求的,Cross-Origin Resource Sharing,就是跨域的目标服务器要返回一系列的Headers,通过这些Headers来控制是否同意跨域. ...

  5. .NET生成静态页面的方案总结

    转载自:http://www.cnblogs.com/cuihongyu3503319/archive/2012/12/06/2804233.html 方法一:在服务器上指定aspx网页,生成html ...

  6. ITK 3.20.1 VS2010 Configuration 配置

    Download ITK 3.20.1 Download VS2010 Download CMake 3.2.0 I assume you've already installed VS2010 an ...

  7. 【GK101 谐波数据生成器】上位机软件升级(版本:1.1)

    ============================= 技术论坛:http://www.eeschool.org 博客地址:http://xiaomagee.cnblogs.com 官方网店:ht ...

  8. c#String的不变特性,可读但不可写性

    谈到字符串,大家自然觉得简单,但是总是有一些小的问题隐约出现,下面我就系统的说一下字符串的问题,有说不到日后再予补充. 1,首先String是一个类,string只是String类的一个别名,别名的意 ...

  9. NV Perf Kit

    https://developer.nvidia.com/gameworksdownload#?dn=perfkit-4-0-0 Title Version Release Date PerfKit  ...

  10. Apache Spark源码走读之22 -- 浅谈mllib中线性回归的算法实现

    欢迎转载,转载请注明出处,徽沪一郎. 概要 本文简要描述线性回归算法在Spark MLLib中的具体实现,涉及线性回归算法本身及线性回归并行处理的理论基础,然后对代码实现部分进行走读. 线性回归模型 ...