星空网 > 软件开发 > 操作系统

【代码笔记】获得当前的月的天数

一,代码。

【代码笔记】获得当前的月的天数images/loading.gif' data-original="http://common.cnblogs.com/images/copycode.gif" />
#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {  [super viewDidLoad];  // Do any additional setup after loading the view, typically from a nib.    NSLog(@"8月的天数%ld",(long)[self getCurrentDay:8]);  }#pragma -mark -functions//获得当前的月的天数-(NSInteger )getCurrentDay:(int) currentMonth{  if (currentMonth < 8 ) {    if (currentMonth %2 ==1) {      return 31;    }else{      return 30;    }  }else{    if (currentMonth %2 ==1) {      return 30;    }else{      return 31;    }  }  }- (void)didReceiveMemoryWarning {  [super didReceiveMemoryWarning];  // Dispose of any resources that can be recreated.}@end
【代码笔记】获得当前的月的天数

 

二,输出。

2015-10-19 13:33:04.785 获得当前的月的天数[5116:115173] 8月的天数31

 

 


 

原标题:【代码笔记】获得当前的月的天数

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

通宝国际物流:https://www.goluckyvip.com/tag/42483.html
通成物流单号查询:https://www.goluckyvip.com/tag/42484.html
通达供应链:https://www.goluckyvip.com/tag/42485.html
通达海外仓:https://www.goluckyvip.com/tag/42486.html
通达全球:https://www.goluckyvip.com/tag/42487.html
通哥聊跨境:https://www.goluckyvip.com/tag/42488.html
23点聊电商:新质生产力加速数字贸易发展 卓尔智联集团实现营收利润双增长 :https://www.kjdsnews.com/a/1836411.html
南京浦口都有什么好玩的地方 南京浦口都有什么好玩的地方推荐:https://www.vstour.cn/a/363180.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流