21.获取当前版本

@"CFBundleVersion"];

22.控件的动画效果


 

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
if (isOn) {
isOn=NO;

self.titleLab.hidden=YES;
self.ipLab.hidden=YES;
self.switcher.frame = CGRectMake(150,  339, 50, 32);
else
    {
isOn=YES;

self.titleLab.hidden=NO;
self.ipLab.hidden=NO;
self.switcher.frame = CGRectMake(105,  339, 50, 32);

        
    }
    [UIView commitAnimations];

    

23.给一个UIImageView对象 添加单击事件

self.imageView.userInteractionEnabled=YES;
    UITapGestureRecognizer *single=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClickSwitcher:)];
    [self.imageView addGestureRecognizer:single];
release];

    

24.获取当前系统时间,返回string类型

+ (NSString*)GetNowTimeEX
{
NSDateFormatter *formate = [[NSDateFormatter alloc] init];
[formate setDateFormat:@"yyyyMMddHHmmssSSS"];
NSString *nowString = [formate stringFromDate:[NSDate  date]];
[formate release];
return
}


25.转换时间格式,返回string类型

+ (NSString*)GetTimeStringByString:(NSString*)timeStr
{
NSDateFormatter *formate = [[NSDateFormatter alloc] init];
[formate setDateFormat:@"yyyyMMddHHmmss"];
NSDate *ndate = [formate  dateFromString:timeStr];
[formate setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString* timeSting = [formate stringFromDate:ndate];
[formate release];
return
}

26.判断文件是否存在

+ (BOOL)isExsiteFile:(NSString*)filePath
{
if
return NO;
}
NSFileManager *fileMage = [NSFileManager defaultManager];
return [fileMage  fileExistsAtPath:filePath];
}

27. 键盘上的return键改成Done:

textField.returnKeyType =UIReturnKeyDone;

28.textfield设置成为密码框

[textField_pwd setSecureTextEntry:YES];

29.隐藏状态栏

[UIApplication  sharedApplication]setStatusBarHidden:YES animated:NO];

30. 防止屏幕暗掉锁屏

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];