Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 使用NSCalender和NSDateComponents时,如何设置一周的第一天?_Iphone_Cocoa Touch_Ios4_Iphone Sdk 3.0 - Fatal编程技术网

Iphone 使用NSCalender和NSDateComponents时,如何设置一周的第一天?

Iphone 使用NSCalender和NSDateComponents时,如何设置一周的第一天?,iphone,cocoa-touch,ios4,iphone-sdk-3.0,Iphone,Cocoa Touch,Ios4,Iphone Sdk 3.0,我的应用程序的用户可以选择他们喜欢的一周的第一天(即,一周从周四开始) 如何使用NSCalender和NSDateComponents调整一周的第一天?可能重复的 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; [calendar setFirstWeekday:5]; // 5 = Thursday, 1 = Sunday, 2 = Monday, etc.

我的应用程序的用户可以选择他们喜欢的一周的第一天(即,一周从周四开始)

如何使用NSCalender和NSDateComponents调整一周的第一天?

可能重复的
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
[calendar setFirstWeekday:5]; // 5 = Thursday, 1 = Sunday, 2 = Monday, etc.