使NSPopUpButton显示所有我的iCal日历。 [英] Making a NSPopUpButton display all my iCal Calendars.

查看:164
本文介绍了使NSPopUpButton显示所有我的iCal日历。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个NSPopUpButton,我想要菜单项目中显示用户iCal日历。

I have a NSPopUpButton and I want the Menu Items in it to display the users iCal calenders. From there I want it depending on which is selected to change this code.

CalCalendar *calendar = [[store calendars] objectAtIndex:0];

代码定义要同步到哪个iCal日历,目前为默认日历,

The code defines which iCal calender to sync to, at the moment it's the default calender, however I want to change the calender to sync to depending on the Calender selected in the PopUp.

我的问题:如何使NSPopUpButton显示所有用户的iCal日历,并根据哪个一个选择要更改日历以同步?我目前只是使用上面的代码将其设置为默认值。

My Question : How do I make the NSPopUpButton display all the users iCal calenders and depending on which one is selected to change the calender to sync to? I'm currently just using the code above which sets it to the default one.

推荐答案

这将使用所有iCal日历的名称填充空NSPopUpButton:

This fills an empty NSPopUpButton with the names of all iCal calendars:

for (CalCalendar* cal in [[CalCalendarStore defaultCalendarStore] calendars])
    [myPopUpButton addItemWithTitle:[cal title]];

这篇关于使NSPopUpButton显示所有我的iCal日历。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆