0

我已经和 Kal 一起工作了 3 周。我能够修改假期示例以使用我的数据并向下钻取。我正在尝试创建简单的工作流程来构建。

我可以显示日历,但是当我尝试标记日期时出现异常错误:

在第一次开始这个过程时,我有一个关于委托的错误,我读到我需要改变这个

 */
 @interface KalViewController : UIViewController <KalViewDelegate, KalDataSourceCallbacks>
 {
   KalLogic *logic;
   UITableView *tableView;
   id <UITableViewDelegate> delegate;
   id <KalDataSource> dataSource;
   NSDate *initialDate;                    // The date that the calendar was initialized with *or* the currently selected date when the view hierarchy was torn down in order to satisfy a low memory warning.
   NSDate *selectedDate;                   // I cache the selected date because when we respond to a memory warning, we cannot rely on the view hierarchy still being alive, and thus we cannot always derive the selected date from KalView's selectedDate property.
  }

   @property (nonatomic, assign) id<UITableViewDelegate> delegate;
   @property (nonatomic, assign) id<KalDataSource> dataSource;
   @property (nonatomic, retain, readonly) NSDate *selectedDate;

对此

 @interface KalViewController : UIViewController <KalViewDelegate, KalDataSourceCallbacks>
 {
 KalLogic *logic;
  UITableView *tableView;
 __weak id <UITableViewDelegate> delegate;
 __weak id <KalDataSource> dataSource;
NSDate *initialDate;                    // The date that the calendar was initialized with *or* the currently selected date when the view hierarchy was torn down in order to satisfy a low memory warning.
 NSDate *selectedDate;                   // I cache the selected date because when we respond to a memory warning, we cannot rely on the view hierarchy still being alive, and thus we cannot always derive the selected date from KalView's selectedDate property.

}

 //@property (nonatomic, assign) id<UITableViewDelegate> delegate;
 //@property (nonatomic, weak) id <UITableViewDelegate> delegate;
 //@property (nonatomic, weak) id <KalDataSource> dataSource;
 @property ( weak) id <UITableViewDelegate> delegate;
 @property ( weak) id <KalDataSource> dataSource;
 @property (nonatomic, retain, readonly) NSDate *selectedDate;

这是摆脱委托错误的正确方法吗?

4

0 回答 0