IOS 数组排序、转字符、字符拼接、corn表示式用法
2020-05-14 本文已影响0人
xiaovtoulu
最终目的是达到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];