Objective c Tapku日历不显示
我已使用以下步骤将Tapku日历库安装到我的项目中: 太好了,很好。没有错误,什么都没有。但是日历不会显示,即使是运行Objective c Tapku日历不显示,objective-c,ios6,tapku,Objective C,Ios6,Tapku,我已使用以下步骤将Tapku日历库安装到我的项目中: 太好了,很好。没有错误,什么都没有。但是日历不会显示,即使是运行loadView功能的日历也不会显示。切换按钮出现[虽然在本例中我没有使用它们进行切换] 这里有一个重要提示: #import <UIKit/UIKit.h> #import "TKCalendarMonthView.h" @interface CalendarViewController : UIViewController <TKCalendarMonth
loadView
功能的日历也不会显示。切换按钮出现[虽然在本例中我没有使用它们进行切换]
这里有一个重要提示:
#import <UIKit/UIKit.h>
#import "TKCalendarMonthView.h"
@interface CalendarViewController : UIViewController <TKCalendarMonthViewDelegate,TKCalendarMonthViewDataSource> {
TKCalendarMonthView *calendar;
struct CGRect cframe;
}
@property(strong, nonatomic) TKCalendarMonthView *calendar2;
@end
此代码(来自实现):
正在屈服:
2012-12-11 17:16:46.294 MyApp[29078:c07] Toggle called!
2012-12-11 17:16:46.295 MyApp[29078:c07] y and x = 0.000000 & 0.000000
2012-12-11 17:16:46.295 MyApp[29078:c07] height and width = 0.000000 & 0.000000
注意y和x是如何为零的,尽管我已经将它们设置为1。就像日历2没有保存任何东西一样
这是课程:
#import <UIKit/UIKit.h>
#import "TKCalendarMonthView.h"
@interface CalendarViewController : UIViewController <TKCalendarMonthViewDelegate,TKCalendarMonthViewDataSource> {
TKCalendarMonthView *calendar;
struct CGRect cframe;
}
@property(strong, nonatomic) TKCalendarMonthView *calendar2;
@end
CalendarControlView.h:
#import <UIKit/UIKit.h>
#import "TKCalendarMonthView.h"
@interface CalendarViewController : UIViewController <TKCalendarMonthViewDelegate,TKCalendarMonthViewDataSource> {
TKCalendarMonthView *calendar;
struct CGRect cframe;
}
@property(strong, nonatomic) TKCalendarMonthView *calendar2;
@end
我正在运行XCode 4.5.2和iOS6移动行:
_calendar2 = [[TKCalendarMonthView alloc] init];
_calendar2.delegate = self;
_calendar2.dataSource = self;
从initWithNib…
到loadView
的开头,然后将日历视图添加到控制器的视图中:
- (void)loadView {
[super loadView];
// Costruct the view because we aren't using a xib file
_calendar2 = [[TKCalendarMonthView alloc] init];
_calendar2.delegate = self;
_calendar2.dataSource = self;
[self.view addSubview:_calendar2];
// rest of the method unchanged....
实际上,由于您没有使用nib,因此不会调用
initWithNib…
loadView
负责创建视图。您没有使用NIB,而是使用loadView-您确定调用了initWithNibName吗?@TommyCrush请查看上面的评论。您是否尝试过记录日志或使用调试器?