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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:31:30+00:00 2026-05-23T16:31:30+00:00

I have a UIView control in the nib file that I am working on.

  • 0

I have a UIView control in the nib file that I am working on. In that UIView I am able to place other nib files. When the iPad is rotated the -(void)deviceOrientationChanged:(NSNotification *)note{ method gets executed and I resize the UIView depending if the iPad entered landscape or portrait mode. In the subclass (the nib file that is in the UIView controll) I need to know if the iPad enteres landsape mode or portrait mode as well. Bellow is a picture demonstrating the nib file that contains a UIView control and that UIView control containing another nib file:

enter image description here

green rectangle is a UIView control and inside I have placed another xib file.

So I placed the same delegate - (void)deviceOrientationChanged:(NSNotification *)note{ . the problem when I do that is that sometimes the subview delegate get’s executed and the other delegate does not. That only happens on the real iPad and not in the simulator. If the iPad enters landscape mode I would like both delegates to get executed. Most of the time this is not a problem but if I tilt the iPad a little bit just one delegate will get executed. That’s why I was thinking about calling a method in the subclass when its frame get’s resized. Also I know that I can call a method from the green nib file but this is like a powerpoint presentation where there are about 60 slides therefore I am just changing the view’s dinamicaly. In c# I would be able to call a method of a dynamic data type using reflection. I don’t konw if something similar exist for the iPhone.

IN SHORT I WANT BOTH DELEGATES (THE ONE FROM THE NIB FILE THAT I AM WORKING WITH AND THE SUBVIEW OF THE UIVIEW CONTROL) TO GET EXECUTED AT THE SAME TIME.

  • 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-23T16:31:30+00:00Added an answer on May 23, 2026 at 4:31 pm
    BOOL myBool;
    
    // this function get's called when the orientation of the ipad changes
    - (void)deviceOrientationChanged2:(NSNotification *)note{
    
        // do not call this method untill other method finish executing it...
        if(myBool==YES)
            return;
    
        myBool=YES;
    
    
        // wait half a second then call handlerTimer method
        NSTimer *timer;
        timer = [NSTimer scheduledTimerWithTimeInterval: (.5)
                                                 target: self
                                               selector: @selector(handleTimer:)
                                               userInfo: nil
                                                repeats: NO];
    }
    
    -(void) handleTimer:(NSTimer*)theTimer{
    
        // this method just uses a diferent image on landscape mode compared to portrait mode
    
    
        // if the image is in landscapemode for example and it is the one for landscape then don't change its alpha the image will not be changed
        if( (imgTextbox.image == [UIImage imageNamed:@"introPaswordVertical.png"] && [super view].frame.size.width>800) || (imgTextbox.image == [UIImage imageNamed:@"introPasswordHorizontal.png"] && [super view].frame.size.width<800))
        {
            imgTextbox.alpha = 0;
        }
    
    
        // if the super view is in portrait mode then place the vertical image
        if([super view].frame.size.width<800)
        {
            imgTextbox.image = [UIImage imageNamed:@"introPaswordVertical.png"];
        }
        else // otherwise place the otherone
        {
            imgTextbox.image = [UIImage imageNamed:@"introPasswordHorizontal.png"];
    
        }
    
        // animate the image
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:0.55];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
        imgTextbox.alpha = 1;
        [UIView commitAnimations];
    
        myBool=NO;  // enable deviceOrientationChanged2 to be called again
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView control (white rectangle in image) Moreover I am able to
I have a UIViewController subclass to control a UIView that I want to add
I have subclassed UIView and created a NIB that controls the main logic for
I have a custom control (UIView subclass) that is identical to slide to unlock
I have a UIView -- call it HomeView that contains a UITableView and a
I have a UIView that gets added to my UITableView .view as a subview.
I have a UIView that I am rendering a UIBezierPath in based on touchesBegan
I have a class that inherits from UIView, and this class has some controls
I want to rotate a image with UIslider control. I have done that with
I have a UIScrollView to which I append multiple custom UIView's that contain UITextFields...

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.