您的位置:首页 > 移动开发 > IOS开发

根据不同的系统走不同的流程 iOS 发布时隐藏NSLog

2015-11-26 19:21 531 查看
//

// ViewController.m

// differentVersions

//

// Created by wusiping on 15/11/21.

// Copyright (c) 2015年 wusiping. All rights reserved.

//

#import "ViewController.h"

#define iOS8 [[UIDevice currentDevice].systemVersion intValue] ==
8

#define iOS7 [[UIDevice currentDevice].systemVersion intValue] ==
7

#define iOS9 [[UIDevice currentDevice].systemVersion intValue] ==
9

// 自定义Log

#ifdef DEBUG

#define NSLog(...) NSLog(__VA_ARGS__)

#else

#define NSLog(...)

#endif

@interface
ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {

[superviewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

if (iOS8) {

NSLog(@"走流程8");

}else if(iOS7){

NSLog(@"走流程7");

}

}

- (void)didReceiveMemoryWarning {

[superdidReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

@end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: