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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:08:01+00:00 2026-05-22T21:08:01+00:00

To begin, I would like to apologize for my English :) I have FirstViewController,

  • 0

To begin, I would like to apologize for my English 🙂

I have FirstViewController, which contains scrollView. This is scrolView with enabled paging, and have 2 pages with 2 different view controllers. From one of the view controllers by touching the button the third view controller appears like a modal view. I call a method in FirstViewController that must disable scrolling and hide two labels which is not contained in the scrollView.
Method is executing, but UI not changes, scrolling still enabled and labels still visible.

Now a bit of code:

This is a piece of the FirstViewController.h (not the whole code):

@interface FirstViewController : UIViewController <UIScrollViewDelegate> {

    IBOutlet UIScrollView *scrollView;
    IBOutlet UILabel *label1;
    IBOutlet UILabel *label2;

}

@property (nonatomic, retain) UILabel *label1;
@property (nonatomic, retain) UILabel *label2;
@property (nonatomic, retain) UIScrollView *scrollView;

-(void)prepareToModal;


@end

Now it’s -(void)prepareToModal; implementation:

-(void)prepareToModal {
    [label1 setHidden:YES];
    [label2 setHidden:YES];
    scrollView.scrollEnabled = NO;
}

So, from the one of the view controllers, which contained in scrollView, I call prepareToModal

Previously:

#import "FirstViewController.h"

Next:

FirstViewController *vc = [[FirstViewController alloc] init];
[vc prepareToModal];
[vc release];

So, that’s all. I put a breakpoint in prepareToModal, and it stopped executing. The method is called, but nothing changes on screen…

What am I doing wrong?
How to do this correctly?

Update:

I solved this problem.

When I present this modal view, I wrote this:

ThirdViewController *tvc = [[ThirdViewControler alloc] init];
tvc.delegate  = self;

UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:tvc];

[self presentModalViewController:nc animated:YES];

[tvc release];
[nc release];

Now, insted of [self presentModalViewController:nc animated:YES]; I write this:

[[[[UIApplication sharedApplication].windows objectAtIndex:0] rootViewController] presentModalViewController:nc animated:YES];

And It’s working very well, I don’t need a method -(void)prepareToModal;

Thanks a lot 🙂

  • 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-05-22T21:08:02+00:00Added an answer on May 22, 2026 at 9:08 pm

    Make sure you have hooked up your IBOutlets in Interface Builder.

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

Sidebar

Related Questions

To begin I would like to apologize for my english which is far from
I have CLI/MFC application and I would like to begin to learn how to
We have a company intranet with staff management functions. I would like to begin
I would like to define a new command like this \newcommand{\bob}[1]{\excerpt \begin{lstlisting} {#1} \end{lstlisting}}
Well to begin i would like to mention that the aim of this question
Before I begin, I would like to point out that I have honestly and
I would like to begin developing for the Blackberry platform and, specifically, the Bold
Before I begin, I would like to highlight the structure of what I am
How would you fix this code? template <typename T> void closed_range(T begin, T end)
I would like to bind the << stream operator: for_each(begin, end, boost::bind(&operator<<, stream, _1));

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.