Note that there are some explanatory texts on larger screens.

plurals
  1. POViewcontroller can't push to another view?
    primarykey
    data
    text
    <p>My problem is sample ...But I still don't know why my view won't push to another view ...</p> <p>First ,I add many views in NSMutableArray</p> <pre><code>static NSString *titleKey = @"title"; static NSString *viewControllerKey = @"viewController"; - (void)viewDidAppear:(BOOL)animated { self.menuList = [NSMutableArray array]; FirstView *firstView = [[FirstView alloc]initWithNibName:nil bundle:nil]; [self.menuList addObject:[NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@"FirstView", @""), titleKey, firstView, viewControllerKey, nil]]; [FirstView release]; SecondView *secondView = [[SecondView alloc]initWithNibName:nil bundle:nil]; [self.menuList addObject:[NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@"SecondView", @""), titleKey, secondView, viewControllerKey, nil]]; [SecondView release]; </code></pre> <p>Ok...This how I add viewcontroller in an array ...</p> <p>I want when I press the cell in the table view ,it will go to the view I want to show </p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIViewController *targetViewController = [[self.menuList objectAtIndex: indexPath.row] objectForKey:viewControllerKey]; targetViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [[self navigationController] pushViewController:targetViewController animated:YES]; } </code></pre> <p>After I press the cell , nothing happen </p> <p>First I guess could be I didn't set the Array correctly </p> <p>But When I log the array </p> <p>It really something inside...</p> <p>Here is the result :</p> <pre><code>Log message: MENU LIST ( { title = "FirstView"; viewController = "&lt;Firstview: 0x5822500&gt;"; }, { title = "SecondView"; viewController = "&lt;SecondView: 0x5822870&gt;"; } ) </code></pre> <p>I have no idea why the program won't work......</p> <p>Does anyone have any ideas ???</p> <p>It just a so simple thing ,still stuck here for 3 hours....</p> <p>Many thanks :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload