获取标题,位置,时区,开始日期和结束日期值

时间:2014-08-01 10:04:20

标签: ios7 nsmutablearray ekevent ekeventstore

如何从NSMutableArray事件中访问位置值。当我尝试使用NSLog(@"事件标题:%@",[[events objectAtIndex:i] location]);时,编译器正在抛出多个名为' location&#39的方法;发现结果不匹配,参数类型或属性。如何从这些事件中获取位置值。

事件(     " EKEvent< 0x94a9360> \ n {\ n \ t EKEvent< 0x94a9360> \ n {\ t title = \ t \ t \ tSdsddsd; \ n \ t 位置 = \ t(null); \ n \ t calendar = \ tEKCalendar< 0x9497b90> {title =日历; type = Local; allowsMo​​dify = YES; color =#1BADF8;}; \ n \ t alarm = \ t \ t(null); \ n \ t \ t URL = \ t \ t \ t \ t \ t *(null); \ n \ t lastModified = 2014-07-31 13:35:52 +0000; \ n \ t timeZone = \ tAsia / Kolkata(GMT + 5:30)抵消19800 \ n}; \ n \ t 位置 = \ t(null); \ n \ t startDate = \ t2014-08-01 13:30:00 +0000; \ n \ t endDate = \ t \ tt1414-08-01 14:30:00 +0000; \ n \ t allDay = \ t \ t0; \ n \ t floating = \ t0; \ n \ t recurrence = \ t(null); \ n \ t与会者= \ t(null)\ n};" )

1 个答案:

答案 0 :(得分:0)

如果您有EKEvent对象数组,那么您可以遍历数组以获取所需的数据,如下所示

for (int i = 0; i < events.count; i++)
{
   EKEvent *event = [events objectAtIndex:i];
   NSLog(@"Title: %@\n",event.title);
   NSLog(@"Location: %@\n",event.location);
   NSLog(@"TimeZone: %@\n",event.timeZone);
   NSLog(@"StartDate: %@\n",event.startDate);
   NSLog(@"EndDate: %@\n",event.endDate);
}
相关问题