views:

45

answers:

1

hi ,

I am developing one demo app.

In first view 'Login' button is linked to 'signInAction()' which is as follows. My superview controller is 'LoginController' and subview controller is 'TweetyViewController'..

- (IBAction) signInAction:(id)sender {

    TweetyViewController *tweetyController = [[TweetyViewController alloc] initWithNibName:@"TweetyViewController" bundle:[NSBundle mainBundle]];

    tweetyController.uname = usernameField.text;
    tweetyController.pword = passwordField.text;

    [self.view addSubview:tweetyController.view];

 }

Default orientation is 'Portrait' orientation. when i logged in by 'portrait' view then 'TweetyController' subview works fine all buttons are working.

but when my application loads and I changed orientation to 'Landscape', and logged in then only UITextView works but button does not work, it can't understand touch event.

All IB setting are right.

Please help me if am doing wrong?

A: 

hi,

I solve this because when orientation changes i declared frame for buttons,images,etc. but never set view frame size due to that button position is out of frame,so i did following changes for landscape ,

self.view.frame = CGRectMake(0,0,480,320);

now i can click on button but when my application loads i.e. loginController in portrait mode and i enter in to subview then subview works fine,but after that when i rotate subview from portrait to landscape, it gives following error for button click. -

Program received signal:  “EXC_BAD_ACCESS”.
[Switching to process 250 thread 0x4927]
[Switching to process 250 thread 0x4927] 

It work for both the view at first time only,once i change orientation it gives above problem.

please help me.

Thanks in advance, Vicky.

vicky