10 2014 档案
输出位数补全位数格式
摘要:printf格式输出:%[flags][width][.perc][F|N|h|l]type用到了flags中的 0 (注意是零不是欧) ,其百科描述为:将输出的前面补上0,直到占满指定列宽为止(不可以搭配使用-)width 即表示需要输出的位数。inta=4;printf("%03d",a);输出... 阅读全文
posted @ 2014-10-15 15:12 助金 阅读(232) 评论(0) 推荐(0)
iOS获取电量方法
摘要:ios简单的方法:[UIDevice currentDevice].batteryMonitoringEnabled = YES;doubledeviceLevel = [UIDevice currentDevice].batteryLevel;获取当前剩余电量, 我们通常采用上述方法。这也是苹果官... 阅读全文
posted @ 2014-10-10 14:50 助金 阅读(821) 评论(0) 推荐(0)
直接读取状态栏上信息获取网络状态-可以扩展获取电量运营商等信息
摘要:直接读取状态栏上信息获取网络状态-可以扩展获取电量运营商等信息-(NSString *)getNetWorkStates{ UIApplication *app = [UIApplication sharedApplication]; NSArray *children = [[[app val... 阅读全文
posted @ 2014-10-10 11:34 助金 阅读(216) 评论(0) 推荐(0)