title: is it possible to push a viewcontroller from within a subclass?
body: <p>I've created a navigationController application and it has within the stack a subclass which basically looks like this:</p>
  
  <ul>
  <li>rootViewController</li>
  <li>leaderboardViewController &lt;----- UITableView within this VC set to files owner
  <ul>
  <li>UITableViewCell
  <ul>
  <li>UICollectionView &lt;----- this is where I'm trying to push a new view controller</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>Inside the collectionView didSelect method which is in the 
  UITableViewCell.m file:</p>
  
  <pre><code>- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      userCell *user = (userCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
      imageTag = ((UICollectionView *)user).tag;
      leaderboardViewController *leaderboardView = [[leaderboardViewController alloc] init];
      [imageManager getInsightWithCompletionBlock:^(UIImage *image){
            [leaderboardView postInfo];
  
      }];
  }
  </code></pre>
  
  <p>then in the leaderBoardViewController.m is the postInfo method:</p>
  
  <pre><code>-(void)postInfo
  {
      NSLog(@"posted!");
      largeInsight *detailedInsight = [[largeInsight alloc] initWithNibName:@"largeInsight" bundle:[NSBundle mainBundle]];
      [[self navigationController] pushViewController:detailedInsight animated:YES];        
  }
  </code></pre>
  
  <p>the NSLog appears in the debug area so the postInfo function is running but it just doesn't push the new viewController. I'm guessing it's something I've missed or I'm doing something I'm not supposed to... I don't think its because of the UICollectionView subclass as I'm referring back to the leaderboardViewController. I just don't know why it's not running that navigationController bit of code. Has anyone come across this same problem? Thanks!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>with some help, I've removed the new instance variable of <code>leaderboardViewController</code> and put in <code>NSNotificationCenter</code> that points to the VC to run the <code>postInfo</code> method when the notification is sent: </p>
  
  <pre><code>- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      userCell *user = (userCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
      imageTag = ((UICollectionView *)user).tag;
  
      [imageManager getInsightWithCompletionBlock:^(UIImage *image){[[NSNotificationCenter defaultCenter] postNotificationName:@"PostCellInformation" object:self];
      }];
  }
  </code></pre>
  
  <p>then in leadboardVC.m where the collectionView is initialised:</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(postInfo) name:@"PostCellInformation" object:nil];
  </code></pre>