Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8258127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:25:54+00:00 2026-06-08T02:25:54+00:00

I use this code to move to DetailView from TableView: – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

  • 0

I use this code to move to DetailView from TableView:

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:TRUE];
  if(indexPath.row==0) {

      //Initialize the detail view controller and display it.
      Detail1ViewController *firstDetailController = [[Detail1ViewController alloc] initWithNibName:@"Detail1ViewController" bundle:nil];
      [self.navigationController pushViewController:firstDetailController animated:YES];
      [firstDetailController release];
}
else if(indexPath.row==1) {

    //2nd view
}
else if(indexPath.row==2) {

    //3rd view
}
}

The Detail1ViewController in the Storyboard is only a UIScrollView with no UIView behind it.

This is the Detail1ViewController.h:

#import <UIKit/UIKit.h>

@interface Detail1ViewController : UIViewController {
 IBOutlet UIScrollView *detail1Scroller;
}

@end

and for loading it the .m:

- (void)viewDidLoad
{
[super viewDidLoad];
[detail1Scroller setScrollEnabled:YES];
[detail1Scroller setContentSize:CGSizeMake(320,1100)];
// Do any additional setup after loading the view.
}

I’ve made the connection from “detail1Scroller” to the UISCrollView in Connections Inspector, and wrote “Detail1ViewController” as class for the Detail1ViewController in Identity Inspector. But the app crashes when I’m going to the detail view!

I’ve noticed that in the tutorial I’m following, the UIScrollView is placed upon a UIView, which I haven’t done in my project. So I tried to create a TestViewController with the UIScrollView inside a UIView, but then the “detail1Scroller” Outlet isn’t showing in the Connections Inspector as it does in the tutorial! Can someone please help me solve this, and also make it clear if I should use the UIScrollView with a UIView behind or not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:25:55+00:00Added an answer on June 8, 2026 at 2:25 am

    A storyboard is a way to configure instances of view controllers, and instantiate them over and over again either automatically through segues or manually with code. When you’re designing a view controller in the storyboard, you’re not designing the class, you’re designing a specific instance of the class. It’s legal to have two instances of the same view controller class in the storyboard, with different view layouts.

    That means that if you directly allocate an instance of your view controller class, it won’t come with all of the UI that you specified in the storyboard. That’s effectively whats happening with this code:

    Detail1ViewController *firstDetailController = [[Detail1ViewController alloc] initWithNibName:@"Detail1ViewController" bundle:nil];
    [self.navigationController pushViewController:firstDetailController animated:YES];
    [firstDetailController release];
    

    There’s also a bit of confusion there in that you’re specifying a NIB name even though you didn’t design a XIB/NIB in Xcode.

    To allocate a new copy of the view controller that you designed in your storyboard, you should use the -[UIStoryboard instantiateViewControllerWithIdentifier:] method. The identifier value should match the value in the storyboard identity inspector.

    Your code should then look like this:

    Detail1ViewController *firstDetailController = [[self storyboard] instantiateViewControllerWithIdentifier:/* my identifier */];
    [self.navigationController pushViewController:firstDetailController animated:YES];
    

    If you’re using a storyboard for the view controller with this code, you should also consider using a segue to initiate this transition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i Use this code to move from one class to another. I don't use
I use this code to select password field from the sql server 2012 db,
I use this code to process a date string coming in from a json
I use this code which is taken from MVC futures and attach the Attribute
I am using this code to move back to tableview but it gives error
I use this code : MethodInvoker TileLoadCompleteMethodInvoker = delegate() { CleanStatusLabelTimer.Enabled = true; MemoryTextBox.Text
i use this code in my app. just found is not correct when compare
I use this code to connect to SQL Server 2012, but it does not
I use this code , to log $_SERVER['REMOTE_ADDR']; to my small db my issue
I use this code to update data in database table. Can reuse same code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.