特定の日にローカル通知を発行する方法を理解しようとしています。NSCalendarユニットの理解(私が5歳だったかのように説明してください)
私はカレンダー単位を使用する必要がありますが、私がそれらについて見つけた説明は臭い部分です。皆さんは私が5歳のように説明してください、彼らはどのような間隔を表していますか?
私は私が知っていると思うものを埋めました。私が間違っていて、他の人を埋めるなら、私を修正してください。
NSEraCalendarUnit = ????? era?
NSYearCalendarUnit = event will repeat once in a year at the same month, day and hour
NSMonthCalendarUnit = event will repeat once a month at the same day and hour
NSDayCalendarUnit = event will repeat every day at the same hour
NSHourCalendarUnit = event will repeat every hour at the same minute
NSMinuteCalendarUnit = event will repeat every minute at the same second
NSSecondCalendarUnit = event will repeat every second
NSWeekCalendarUnit = event will repeat the same day of week every week
NSWeekdayCalendarUnit = ?????? can I make it repeat just specific days? I mean, monday to friday but not saturday and sunday?
NSWeekdayOrdinalCalendarUnit = ????? how do I use that?
NSQuarterCalendarUnit = when exactly will it repeat? every 3 months?
NSCalendarCalendarUnit = ?????????
NSTimeZoneCalendarUnit = ????????
これは私が何をする必要があるかの例である:月曜日から毎日発射する
- :
UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease]; if (alarm) { alarm.fireDate = aDate; alarm.timeZone = [NSTimeZone systemTimeZone]; alarm.repeatInterval = WHAT DO I PUT HERE? TO MAKE IT REPEAT JUST SATURDAYS AND SUNDAYS?; alarm.soundName = @"alarm.caf"; alarm.alertBody = @"hi there"; [app scheduleLocalNotification:alarm]; }
は、私はこれらの可能性のうちの1つでローカルの通知をプログラムする必要があります土曜日と日曜日を除く金曜日まで
- 土曜日と日曜日を除くすべての火曜日に火曜日
- は毎週同じ週の曜日に繰り返されます
これを達成するにはどのような値を使用しますか?
ありがとうございました
良いアイデア、ありがとう。私の質問に疑問符をつけたエントリはどうしたらいいのですか? NSWeekdayCalendarUnitは何ですか? NSCalendarCalendarUnitはどうですか? Appleはこれらの人に卑劣な文書を書いてもらう必要があります。彼らのドキュメントは、品質の話す彼らの製品の逆です。 – SpaceDog