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 8288887
In Process

The Archive Base Latest Questions

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

(In XCode 4 with Storyboards, app for iPhone) My DetailView: a UIView filled with

  • 0

(In XCode 4 with Storyboards, app for iPhone)

My DetailView: a UIView filled with Labels and ImageViews to display details recieved through a segue when a cell was selected in the MainTableViewController. Now I’ve added a UIScrollView on this UIView because I want the Labels and ImageViews to be diplayed in a scroll view instead.

The only thing visible in DetailViewController now when I run the app, is a blank ScrollView. None of the content I’ve passed from the TableView is displayed, it’s not getting the selectedObject. How can I display my content and be able to swipe through the cells with swipeDetectedLeft now after the UIScrollView was added? I would be happy if you could make example with my code.

DetailViewController.h:

@interface DetailViewController : UIViewController {
    IBOutlet UIScrollView *viewScroller; 
    //Added a ScrollView..
    }

@property (strong, nonatomic) NSArray *detailsDataSource; 
//Recieved from the TableView to know the order of the sorted TableView cells, cells populated with a mutable array from a plist of dictionaries)

@property int detailIndex; 
//To know which cell selected (for swiping throug cells)

@property (nonatomic, strong) NSString *selectedObject; 
//Content of selected cell from tableview (for swiping through cells)

@property (nonatomic, strong) IBOutlet UILabel *aLabel; 
@property (nonatomic, strong) IBOutlet UIImageView *anImageView; 
//to display content

DetailViewController.m:

#import "DetailViewController.h"

@interface DetailViewController ()

@end

@implementation DetailViewController

@synthesize aLabel,anImageView;
@synthesize selectedObject;

@synthesize detailsDataSource, detailIndex;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
    // Custom initialization
}
return self;
}


- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}

- (void)viewDidLoad
{
[super viewDidLoad];

[viewScroller setScrollEnabled:YES];
[viewScroller setContentSize:CGSizeMake(320, 700)];

//A customized Label for NavigationBar    
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 480, 44)];
label.backgroundColor = [UIColor clearColor];
label.numberOfLines = 2;
label.font = [UIFont boldSystemFontOfSize: 14.0f];
label.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
label.textAlignment = UITextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.text = [selectedObject valueForKey:@"Name"];
self.navigationItem.titleView = label;
[label release];


aLabel.text = [selectedObject valueForKey:@"A Label"];
anImageView.image = [UIImage imageNamed:[selectedWine valueForKey:@"An Image"]];

self.navigationController.navigationBar.translucent = YES;
self.wantsFullScreenLayout = YES;

UISwipeGestureRecognizer *leftGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeDetectedLeft:)];
leftGesture.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:leftGesture];
}

- (void)swipeDetectedLeft:(UISwipeGestureRecognizer *)sender
{
if (detailIndex != [detailsDataSource count])
    detailIndex++;

aLabel.text = [[detailsDataSource objectAtIndex: detailIndex] valueForKey:@"A Label"];
//Here follows ImageView and NavigationbBar Label for the swipe..
}

EDIT:

If I set aLabel.text = @”Test” then it works. So the UIScrollView isn’t getting the selectedObject from:

MainTableViewController.m:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {


if ([[segue identifier] isEqualToString:@"DetailSegue"]) {

    NSIndexPath *selectedRowIndex = [self.tableView indexPathForSelectedRow];
    DetailViewController *detailViewController = [segue destinationViewController];

    detailViewController.selectedObject = [sortedObjects objectAtIndex:selectedRowIndex.row];

    detailViewController.detailsDataSource = [[NSArray alloc]initWithArray:sortedObjects];
    detailViewController.detailIndex = selectedRowIndex.row;
}
}
  • 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-08T12:22:28+00:00Added an answer on June 8, 2026 at 12:22 pm

    Actually the answer was very simple: I just had to remove the UIView from the scene in the storyboard and place the UIScrollView directly onto the DetailViewController scene instead.

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

Sidebar

Related Questions

I recently created an iPhone app using Xcode and storyboards. The app works perfectly
I am using xcode 4.2 with storyboard to create an iphone app. When I
I am creating an iPad app using XCode 4 and Storyboards. I have a
I'm writing an iOS 5 app (in Xcode 4.3, using Storyboards and ARC) that
I am new to iPhone app. I was told not to use Xcode storyboard
I have an iPhone app I'm currently building in XCode 4.3 with Storyboard. I
I am developing an app for iPhone using iOS5 and xcode 4.2. The scenario
I have a TabBar app built in Xcode 4.2.1 using storyboards. The problem is
We have an app we are designing using iOS 5 storyboards (Xcode 4.4, Mountain
I am developing an app (XCode 4 with storyboards, iOS5, single view app) that

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.