views:

29

answers:

1

Hi,

For my iPad app, I'm using a UIViewController subclass called SidebarViewController to display some stuff in a sidebar. In the sidebar I have a calendar control. I'm using the open source Kal component from http://github.com/klazuka/Kal. In the -viewDidLoad method of SidebarViewController, I'm creating a new instance of KalView (the main view for the calendar) and adding it as a subview of SidebarViewController's view:

_logic = [[KalLogic alloc] initForDate:[NSDate date]];
_calendarView = [[KalView alloc] initWithFrame:CGRectMake(0.0, 62.0, 273.0, 239.0) delegate:self logic:_logic];
KalDate *currentDate = [KalDate dateFromNSDate:[NSDate date]];
[_calendarView selectDate:currentDate];
[self.view insertSubview:_calendarView atIndex:0];

The calendar displays and everything, but there's one problem. The main component of the calendar is the KalGridView, which is a subview of KalView. It displays the date tiles, etc. When the app starts, for some reason, the KalGridView does not receive touches. The touches are intercepted by SidebarViewController's view. Weirdly enough, if I tap the month change buttons at the top of the calendar to change the month, the KalGridView starts receiving touches again.

I can't figure out why this is happening, because none of the other subviews of SidebarViewController are affected by the same issue.

A: 

Creating the KalView in the XIB instead of creating it in code seemed to solve the problem. This definitely looks like a bug, but I don't know the circumstances under which it can be reproduced so I don't think I can file it.

macatomy