I’m using storyboards and table views with static content. Internally it seems as if the UITableViewController implicitly becomes the source of the UITableView.
If I now want to take influence on the static content, I will have to override methods of the table source. In ObjectiveC I can just place
-(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
if (section == 0)
return @"HELLO!";
else {
return [super tableView:tableView titleForHeaderInSection:section];
}
}
in my controller and the method will be overridden. But in MonoTouch this does not work.
Please note that I do NOT want create a new instance of a delegate or a data source. With static cells, the controller is the source/delegate. In ObjectiveC this is done by making the controller implement the corresponding protocols.
Here is the question I asked related to this topic but now I’m stuck converting the solution to MonoTouch:
How to override tableView:titleForHeaderInSection: to adjust section headers of static UITableViews?
Found the solution in the great tutorials on Xamarin’s website: http://docs.xamarin.com/ios/tutorials/Events%2c_Protocols_and_Delegates
The “
Export” attribute does the trick!