呆呆陈

博客园 首页 新随笔 联系 订阅 管理

NSString *weekStr = @"周二";

NSInteger  weekday = [self passday:weekStr];

 

-(NSInteger)passday:(NSInteger)day andWeekDay:(NSString *)weekday{

    if([weekday isEqualToString:@"周日"]) {

        day= 7;

    }  else if([weekday isEqualToString:@"周六"]) {

        day= 6;

    } else if([weekday isEqualToString:@"周五"]) {

        day= 5;

    } else if([weekday isEqualToString:@"周四"]) {

        day= 4;

    }  else if([weekday isEqualToString:@"周三"]) {

        day= 3;

    }  else if([weekday isEqualToString:@"周二"]) {

        day= 2;

    }  else if([weekday isEqualToString:@"周一"]) {

        day= 1;

    }

    return day;

}

 

posted on 2016-12-23 09:30  我是一只萌妹子  阅读(120)  评论(0编辑  收藏  举报