首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

给app加下时间限制

2013-02-28 
给app加上时间限制 NSDate *senddate[NSDate date]NSCalendar* cal[NSCalendarcurrentCalendar]NSUInt

给app加上时间限制

 NSDate *  senddate=[NSDate date];    NSCalendar  * cal=[NSCalendar  currentCalendar];    NSUInteger  unitFlags=NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit;    NSDateComponents * conponent= [cal components:unitFlags fromDate:senddate];    NSInteger year=[conponent year];    NSInteger month=[conponent month];    NSInteger day=[conponent day];    int dayNum = year*10000+month*100+day;    if(dayNum>20130222&&dayNum<20130310)    {         if(g_sqlite==nil)     {        g_sqlite = [[CSqlite alloc]init];        [g_sqlite openSqlite];     }    }    else{        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"您当前使用的是测试版本,已过测试期限,请联系开发商" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];        [alert show];    }

热点排行