1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 
	if(contentRows == 0) { 
		return 0; 
	} else if(adDidLoad) { 
		if(section == kAdSection) { 
			return contentRows > kAdSectionRowOffset ? contentRows - kAdSectionRowOffset : 0; 
		} else { 
			return contentRows >= kAdSectionRowOffset ? kAdSectionRowOffset : contentRows; 
		} 
	} else { 
		if(section == kTopSection) { 
			return contentRows; 
		} else { 
			return 0; 
		} 
	} 
} 

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { 
	if(section == kAdSection && adDidLoad) { 
		return adView; 
	} 
	
	return nil; 
}