2011-09-17 9 views
0

私は、異なるrepeatIntervalsでいくつかのUILocalNotificationsを作成しています。iPhone UILocalNotificationの値

すべての繰り返し間隔は

myNotification.repeatInterval = NSWeekdayCalendarUnit; 

のように私がデバッグ午前、NSCalendarUnitを使用して割り当てられます。私は

NSArray* oldNotifications = [app scheduledLocalNotifications]; 
NSLog(@"alarms = %@", oldNotifications); 

を使用して通知を含むNSArrayのを印刷するとき、私は通知が、このように印刷された参照:

「{火災日= 2011-09-19 6時26分00秒+0000、タイムゾーン=ヨーロッパ/リスボン(WEST)3600 (夏時間)、繰り返し間隔= 512、次の発射日= 2011年9月19日6時26分00秒 0000}」

を未オフセットこの例では512であるが、繰り返し間隔は数字であるが、256、0、何でもよい。

ここで、NSCalendarUnitと同じ番号の同等性を確認できますか。私は彼らが何であるかを知る必要があるので、私はデバッグすることができます。 Xcodeの "Jump to definition"には数字が表示されません。

おかげ

答えて

0

当たり前!整数での等価性を知っているなど

...

NSLog(@"NSEraCalendarUnit = %d", NSEraCalendarUnit); 
NSLog(@"NSYearCalendarUnit = %d", NSYearCalendarUnit); 
NSLog(@"NSMonthCalendarUnit = %d", NSMonthCalendarUnit); 
NSLog(@"NSDayCalendarUnit = %d", NSDayCalendarUnit); 
NSLog(@"NSHourCalendarUnit = %d", NSHourCalendarUnit); 
NSLog(@"NSMinuteCalendarUnit = %d", NSMinuteCalendarUnit); 
NSLog(@"NSSecondCalendarUnit = %d", NSSecondCalendarUnit); 
NSLog(@"NSWeekCalendarUnit = %d", NSWeekCalendarUnit); 
NSLog(@"NSWeekdayCalendarUnit = %d", NSWeekdayCalendarUnit); 

:私は簡易印刷このような値でし実現しました。

+0

... [参照](http://developer.apple.com/library/ios/documentation/CoreFoundation/Reference/CFCalendarRef/Reference/reference.html#//apple_ref/doc/uid/TP40001434- CH1g-C007681)。 – albertamg

+0

参照は整数値を与えません。 – SpaceDog

+0

参考文献の抜粋: 'kCFCalendarUnitWeekday =(1 << 9)' – albertamg

1
if we use NSWeekCalendarUnit then we get this. 
fire date = 2011-09-17 09:05:00 +0000, time zone = Asia/Kolkata (GMT+05:30) offset 19800, repeat interval = 256, next fire date = 2011-09-17 09:05:00 +0000 

if we use NSWeekdayCalendarUnit then we get this. 

fire date = 2011-09-17 09:05:00 +0000, time zone = Asia/Kolkata (GMT+05:30) offset 19800, repeat interval = 512, next fire date = 2011-09-17 09:05:00 +0000 

these are pre defind interval by ios we cant change it. 
+0

ありがとう!!!!!!!!!!!!!!!! – SpaceDog

関連する問題