title: Why the image present in the iCarousel view is displayed in the previous screen when I tabbed to previous screen?
body: <p>I've implemented a <code>iCarousel</code> View, it works properly in its actual screen, but when I tabbed to previous or next screens the image present in the carousel view is appearing on the previous or next screen?</p>
  
  <p>I've used the method <code>[carouselviewname setHidden:YES]</code> in <code>-(void)viewWillDisappear</code>; but getting the same error.</p>
  
  <p>Here is the link the carousel that has been used:</p>
  
  <p><a href="https://github.com/nicklockwood/iCarousel" rel="nofollow">https://github.com/nicklockwood/iCarousel</a></p>
  
  <p>Please help me!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
  {
      return [_carouselItems count];
  }
  
  - (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel
  {
      return NUMBER_OF_VISIBLE_ITEMS;//1
  }
  
  - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
  {
      Category *categoryObj = [_categorymAr objectAtIndex:index];
      //create a numbered view
      NSString *imagePath = [[APP_CACHES_DIR stringByAppendingPathComponent:@"catalogues"] stringByAppendingString:[NSString stringWithFormat:@"/%d.jpg", categoryObj.categoryId]];
      if (![[NSFileManager defaultManager] fileExistsAtPath:imagePath]) {
          view = [[UIImageView alloc] initWithImage:[UIImage imageNamed:IS_IPAD?@"Gallery Placeholder.png":@"Gallery Placeholder.png"]];
      } else {
          view = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:[[APP_CACHES_DIR stringByAppendingPathComponent:@"catalogues"] stringByAppendingString:[NSString stringWithFormat:@"/%d.jpg", categoryObj.categoryId]]]];
      }
  
  
  
      if (IS_IPAD) {
          view.frame = CGRectMake(0, 0, 420, 420);
      } else {
          view.frame = CGRectMake(0, 0, 200, 200);
      }
  
      return view;
  }
  
  - (NSUInteger)numberOfPlaceholdersInCarousel:(iCarousel *)carousel
  {
      //note: placeholder views are only displayed on some carousels if wrapping is disabled
      return INCLUDE_PLACEHOLDERS? 2: 0;
  }
  
  - (UIView *)carousel:(iCarousel *)carousel placeholderViewAtIndex:(NSUInteger)index reusingView:(UIView *)view;
  {
      //create a placeholder view
  //  UIView *view = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]];
      UILabel *label = [[UILabel alloc] initWithFrame:view.bounds];
      label.text = (index == 0)? @"[": @"]";
      label.backgroundColor = [UIColor clearColor];
      label.textAlignment = UITextAlignmentCenter;
      label.font = [label.font fontWithSize:50];
  
      _spacePageControl.currentPage = index;
  
  
  //  [view addSubview:label];
      return view;
  }
  
  - (CGFloat)carouselItemWidth:(iCarousel *)carousel
  {
      //usually this should be slightly wider than the item views
      return ITEM_SPACING;
  }
  
  - (CATransform3D)carousel:(iCarousel *)_carousel transformForItemView:(UIView *)view withOffset:(CGFloat)offset
  {
      //implement 'flip3D' style carousel
  
      //set opacity based on distance from camera
      view.alpha = 1.0 - fminf(fmaxf(offset, 0.0), 1.0);
  
      //do 3d transform
      CATransform3D transform = CATransform3DIdentity;
      transform.m34 = _deptCarousel.perspective;
      transform = CATransform3DRotate(transform, M_PI / 8.0, 0, 1.0, 0);
  
      return CATransform3DTranslate(transform, 0.0, 0.0, offset * _deptCarousel.itemWidth);
  }
  
  - (BOOL)carouselShouldWrap:(iCarousel *)carousel
  {
      //wrap all carousels
  //    return NO;
      return wrap;
  }
  
  - (void)carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index {
      if (index == [self.deptCarousel currentItemIndex]) {
          ProductCategoriesViewController *prodCatView = [[ProductCategoriesViewController alloc] initWithNibName:IS_IPAD ? 
                                                          @"ProductCategoriesView~iPad" : @"ProductCategoriesView" bundle:nil];
          Category *categoryObj = [_categorymAr objectAtIndex:index];
          [prodCatView setStrTitle:categoryObj.categoryName];
          [prodCatView setCategoryId:categoryObj.categoryId];
          [Flurry logEvent:@"Category List" withParameters:[NSDictionary dictionaryWithObjectsAndKeys:categoryObj.categoryName,[NSString stringWithFormat:@"%d",categoryObj.categoryId], nil]];
          [self.navigationController pushViewController:prodCatView animated:YES];
      }
  }
  </code></pre>