所以目前,我有这个EkEvent
:
EKEvent <0xb12dc30> {EKEvent <0xb12dc30> {title = Mitchell Smith’s Birthday; location = (null); calendar = EKCalendar <0x9a532c0> {title = Birthdays; type = Birthday; allowsModify = NO; color = #8295AF;}; alarms = (null); URL = (null); lastModified = (null); timeZone = (null)}; location = (null); startDate = 2013-08-13 07:00:00 +0000; endDate = 2013-08-14 06:59:59 +0000; allDay = 1; floating = 1; recurrence = EKRecurrenceRule <0xb2199e0> RRULE FREQ=YEARLY;INTERVAL=1; attendees = (null)}
我成功解析到EKCalendar
Key 这样做:
NSLog(@"%@", [event valueForKey:@"calendar"]);
哪个打印:
EKCalendar <0x9a532c0> {title = Birthdays; type = Birthday; allowsModify = NO; color = #8295AF;}
然后我尝试让EKCalendar
's Color 属性这样做:
NSLog(@"%@", [[event valueForKey:@"calendar"] valueForKeyPath:@"color"]);
哪个打印:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<EKCalendar 0x9a532c0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key color.'
我能够获得 的其他属性EKCalendar
,但是当我访问该color
属性时,我每次都会崩溃:(。所以this class is not key value coding-compliant for the key color
我需要理解的是,有人对如何获得这个值有任何想法吗?
我的主要目标是获取颜色属性,将“十六进制”数字转换为RBG
颜色,然后使用石英显示颜色的小点。我正在将它用于我目前正在实施的日历应用程序。