2011-09-17 4 views
0

다른 repeatIntervals를 사용하여 여러 개의 UILocalNotifications를 만들고 있습니다.iPhone UILocalNotification 값

모든 반복 간격은

내가 디버깅하고
myNotification.repeatInterval = NSWeekdayCalendarUnit; 

처럼 NSCalendarUnit를 사용하여 지정됩니다. 내가

나는이로 인쇄 알림 참조
NSArray* oldNotifications = [app scheduledLocalNotifications]; 
NSLog(@"alarms = %@", oldNotifications); 

사용하여 알림을 포함하는 NSArray를 인쇄 할 때 :

"{화재 날짜 = 2011-09-19 6시 26분 0초 0000을, 시간대 = 유럽/리스본 (WEST)는 오프셋 3600 (일광), "} = 간격 = 512, 다음 화재 날짜

되지 않음을 2011-09-19 6시 26분 0초 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