项目中的一些设置

//设置全屏

self.wantsFullScreenLayout=YES;

//隐藏状态栏

[[UIApplication sharedApplication]setStatusBarHidden:YES]; 

 //在arc的项目里用没有arc的类

-fno-objc-arc


 //在arc的项目里用没有arc的类

-fobjc-arc



//iphone4,4s的分辨率是960x460

发布时需要的icon:


//iphone中获取屏幕分辨率:

CGRect rect = [[UIScreenmainScreen]bounds];
CGSize size = rect.size;
CGFloat width = size.width;
CGFloat height = size.height;


//iphone中获取屏幕可显示区域(不包括状态栏):

CGRect a = [[UIScreen mainScreen] applicationFrame];


//手机不自动锁屏

[UIApplication sharedApplication].idleTimerDisabled=YES;


//是否是第一次运行

if (![[NSUserDefaults standardUserDefaults] boolForKey:@"everLaunched"]) {
        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"everLaunched"];
        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstLaunch"];
    }
    else{
        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"firstLaunch"];
    }
    
    if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]) {
        firstBool = YES;//第一次

    }else{
        firstBool = NO;//第N次

    }


//用DLOG输出 替换NSLog 写在XXX-Prefix.pch里

#if DEBUG
#define DLog(msg, ...) NSLog((@"%s [Line %d] " msg), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DLog(msg, ...) do { } while (0)
#endif

//设备是否时iphone5

#define DEVICE_IS_IPHONE5 ([[UIScreen mainScreen] bounds].size.height == 568)


//去时间栏

View controller-based status bar appearance  NO

Status bar is initially hidden YES


你可能感兴趣的:(ios)