Note that there are some explanatory texts on larger screens.

plurals
  1. POpushViewController from another class
    primarykey
    data
    text
    <p>I want to push a view controller from my <code>FirstViewController</code> to load <code>BookDetailsViewController</code>. here's the setup I currently have.</p> <pre><code>// FirstViewController:(this is inside a uinavigationcontroller) -(IBAction)viewBookDetails:(id)sender { NSLog(@"woo"); BookDetailsViewController *bdvc = [[BookDetailsViewController alloc] init]; [self.navigationController pushViewController:bdvc animated:YES]; } ============================================================== // BookScrollViewController: (where the button is located) [book1UIButton addTarget:self action:@selector(viewBookDetails:) forControlEvents:UIControlEventTouchUpInside]; -(void)viewBookDetails:(id) sender { FirstViewController *fvc = [[FirstViewController alloc] init]; [fvc viewBookDetails:sender]; } ============================================================== //how BookScrollViewController is created BookScrollViewController *controller = [bookViewControllersArray objectAtIndex:page]; if ((NSNull *)controller == [NSNull null]) { NSString *bookTitle = @"ngee"; controller = [[BookScrollViewController alloc]initWithBook:bookTitle imageNamesArray:imgDataArray pageNumber:page totalResult:[newReleasesArray count]]; [bookViewControllersArray replaceObjectAtIndex:page withObject:controller]; [controller release]; } // add the controller's view to the scroll view if (nil == controller.view.superview) { CGRect frame = bookScroll.frame; frame.origin.x = frame.size.width * page; frame.origin.y = 0; controller.view.frame = frame; [bookScroll addSubview:controller.view]; } </code></pre> <p>when I tap the button in <code>BookScrollViewController</code> it calls the <code>IBAction</code> I have in <code>FirstViewController</code> coz it prints my nslog but it's not loading pushing the <code>BookDetailsViewController</code> to the navigation stack. </p> <p>I tried assigning a button from <code>FirstViewController</code> to call the <code>IBAction</code> and it loads just fine. So, how can I successfully call the <code>IBAction</code> from <code>FirstViewController</code> using the button from <code>BookScrollViewController</code>? </p> <p>thanks!</p>
    singulars
    1. This table or related slice is empty.
    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