最终目的是达到corn表达式的目的。
1. 数组排序:NSArray *week = {3,2,4}; weeks = [weeks sortedArrayUsingSelector:@selector(compare:)];
2. 数组转字符串: NSString *strWeek; strWeek = [weeks componentsJoinedByString:@","];
3. 字符拼接: NSString *corn = [@"0 "stringByAppendingFormat:@"%@%@%@%@%@", currentMinute,@" ",currentHour,@" ? * ",strWeek];
网友评论