所以目前,我有這個EkEvent
:獲取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
主要做這個:
NSLog(@"%@", [event valueForKey:@"calendar"]);
它打印:
EKCalendar <0x9a532c0> {title = Birthdays; type = Birthday; allowsModify = NO; color = #8295AF;}
然後我嘗試獲取EKCalendar
的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
屬性,我得到一個崩潰EVERY時間:(。所以this class is not key value coding-compliant for the key color
是我需要了解的,任何人有關於如何獲得這個值的任何想法?
我的主要目標是獲取顏色屬性,將「十六進制」數字轉換爲RBG
顏色,然後使用石英顯示顏色的小圓點。我正在將此用於我目前正在實施的日曆應用程序。
我做了一個編輯的問題,認爲你可以幫忙嗎? :) – jsetting32
沒關係:對不起 – jsetting32