I have a custom UITableViewCell with XIB. It has a webview and UIView named slideShow. I just want to add a custom uiviewcontroller inside slideShow UIView component. While doing that, when i addChildViewController, it is crashing.
I'm able to add this ViewController as a subview in self.view. But not able to add in a view inside custom tableviewcell
Please help..
self.homePageCell = (SSHomePageCell *)[tableView dequeueReusableCellWithIdentifier:@"SSHomePageCell"];
if (self.homePageCell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SSHomePageCell" owner:self options:nil];
self.homePageCell = [nib objectAtIndex:0];
}
self.imageShow = (ImageSlideShowViewController *) [storyboard instantiateViewControllerWithIdentifier:@"ImageSlideShow"];
self.imageShow.view.frame = CGRectMake(0, 0, self.homePageCell.imageSlideShowContainerView.frame.size.width, self.homePageCell.imageSlideShowContainerView.frame.size.height);
self.imageShow.title = self.title;
[self addChildViewController:self.imageShow];
[self.homePageCell.imageSlideShowContainerView addSubview:self.imageShow.view];
[self.imageShow didMoveToParentViewController:self];
return self.homePageCell;