iphone - 使用字典数组中的数据填充 Tapku 日历

标签 iphone objective-c ios ios5 cocos2d-iphone

我有一个数组,里面装满了对应于作业对象的字典。 每个字典都有一个名为 Date 的条目,其中包含一个 NSDate! 每个字典还有一个 Title 条目,其中包含一个 NSString 我想使用 TAPKU 日历在下面的表格 View 中显示标题字符串,如果用户点击日期并且那天有作业到期! 我怎样才能做到这一点? 谢谢!

最佳答案

Tapku 日历有一个方法

- (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)d {}`

其中“d”是点击的日期。有了这个日期,您可以做任何事情。在实现日历的类里面使用它。

我的例子,我用数组中的数据更改按钮的标题,其中包含很多日期的文本:

- (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)d {
    [self setEditButtonTitle:d];
}

- (void)setEditButtonTitle : (NSDate*) d{
    for (int i=0; i<[array count]; i++) {
        if (/*  compare if NSDate from my array is equal to "d" */){
            [editButton setTitle:[array objectAtIndex:i] forState:UIControlStateNormal];
        }
    }
}

部分我不明白的作业:(

关于iphone - 使用字典数组中的数据填充 Tapku 日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12754581/

相关文章:

iPhone + 共享点

iphone - 架构 i386 的重复符号错误

iphone - iPhone 中的日志文件大小

iPhone iOS5 Storyboard 更改导航栏外观

iphone - Objective-C:在 iOS 中转发消息

ios - Xcode Playground 与 Cocoapods

ios - 相机 View 在 Swift 中旋转 90 度

iphone - Sharepoint Web 服务在 iPad 应用程序中使用时返回错误

iphone - 如何像 UITableView 一样重新排序 UIScrollView 行

ios - 在 UIScrollView 中使用 ViewController