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

  • Home
  • SEARCH
  • 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 5844071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:14:33+00:00 2026-05-22T12:14:33+00:00

Hy, There is no problmen with changing the nib but when I’m in the

  • 0

Hy,

There is no problmen with changing the nib but when I’m in the nib-File with the OPGL ES view my buttons that are integrated in this view won’t work. When I press one the application crashes.

This is the Code how I change the View to the Second Nib:

- (IBAction)drawEAGLView:(id)sender {

NSArray* nibViews =  [[NSBundle mainBundle] loadNibNamed:@"settingsViewController" owner:self options:nil];
EAGLView* glView = [ nibViews objectAtIndex: 1];
self.view = glView;
[glView startAnimation];}

The Animation is working .

This is the Code of the ViewController where the Button is declared:

SettingsViewController.h:

#import <UIKit/UIKit.h>


@interface SettingsViewController : NSObject {

    IBOutlet UIButton *wowButton;
}
@property(nonatomic,retain) IBOutlet UIButton *wowButton;

- (IBAction)wowButtonPressed:(id)sender;

int testvarAnimation;
int animNext;


@end

SettingsViewController.m:

#import "SettingsViewController.h"
@implementation SettingsViewController
@implementation SettingsViewController
@synthesize wowButton;


- (IBAction)wowButtonPressed:(id)sender{
    NSLog(@"TOUCHED");
    //testvarAnimation = 1;
    animNext =1;

}

- (void)dealloc {
    [wowButton release];
    [super dealloc];
}


@end

Here I show you how I connected the Functions and the Outlets:
http://s3.imgimg.de/uploads/screenshotConna91ea645png.png

Please tell me If you need more informations.

Thanks

  • 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-22T12:14:33+00:00Added an answer on May 22, 2026 at 12:14 pm

    Here is the right solution for this problem:

    First you have to create a parnet object of your view you want to be shown as first.
    You need to do this in the header file of the second view.

    //
    //  SettingsViewController.h
    //  NeheTutorial2
    //
    //  Created by Global Sound on 05.04.11.
    //  Copyright 2011 __MyCompanyName__. All rights reserved.
    //
    
    #import <UIKit/UIKit.h>
    
    @class EAGLView;
    @class mobilesynthViewController;
    
    @interface SettingsViewController : UIViewController {
    
        IBOutlet UIButton *wowButton;
        IBOutlet UIButton *optiButton;
    
        EAGLView *glView;
        //mobilesynthViewController *mViewController;
        mobilesynthViewController *parent;
    }
    @property(nonatomic,retain) IBOutlet UIButton *wowButton;
    @property(nonatomic,retain) IBOutlet UIButton *optiButton;
    @property (nonatomic, retain) IBOutlet EAGLView *glView;
    //@property(nonatomic,retain) IBOutlet mobilesynthViewController *mViewController;
    
    @property (nonatomic, retain) mobilesynthViewController *parent;
    
    - (IBAction)wowButtonPressed:(id)sender;
    
    - (IBAction)optiButtonPressed:(id)sender;
    
    int testvarAnimation;
    int animNext;
    int musicOn;
    int isAnimating;
    float zaehler;
    
    
    @end
    

    Now in the implemetaion File you need to add the parent object to your function:

    #import "SettingsViewController.h"
    #import "EAGLView.h"
    //#import "mobilesynthViewController.h"
    
    
    @implementation SettingsViewController
    
    @synthesize wowButton, optiButton, glView;//,mViewController;
    @synthesize parent;
    
    - (IBAction)wowButtonPressed:(id)sender{
        NSLog(@"TOUCHED");
        [parent startThread];
        [parent showbButtonStop];
        testvarAnimation = 0;
        animNext =1;
        //musicOn =1;
    }
    
    - (IBAction)optiButtonPressed:(id)sender{
    
        NSLog(@"OPTIONS ON");
        [self dismissModalViewControllerAnimated:YES];
        [parent showbButton];
    
    
    
        //mobilesynthViewController *aRootViewController = [[mobilesynthViewController alloc] initWithNibName:@"mobilesynthViewContoller" bundle:nil];
        //[self setRootViewController:aRootViewController];
        //[aRootViewController release]; 
    
    
        //mobilesynthViewController *mViewController = [[mobilesynthViewController alloc] initWithNibName:@"mobilesynthViewController" bundle:nil];
        //[[self.view superview] addSubview:mViewController.view];
        //self.view = mViewController;
    
        //CGRect rect = [[UIScreen mainScreen] applicationFrame];
        //mViewController = [[mobilesynthViewController alloc] initWithFrame:CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)];
        //self.view = mViewController;
    
    }
    
    - (void)viewDidLoad {
        glView.animationInterval = 1.0 / 60.0;
        [glView startAnimation];
    
        [super viewDidLoad];
    }
    /*
    
    - (void)didReceiveMemoryWarning {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
    
        // Release any cached data, images, etc that aren't in use.
    }
    
    - (void)viewDidUnload {
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }
    */
    - (void)dealloc {
        [wowButton release];
        [optiButton release];
        [super dealloc];
    }
    
    
    @end
    

    In my case I’m calling a other function in the main View of my program. When the button in the second view is pressed the function in the first view is called through the the parent object

    [parent startThread];
    

    Again the startThread methode was declerated in another view.

    I hope I could help you.

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

Sidebar

Related Questions

There is a column that exists in 2 tables. In table 1, this column
There are nice SO question and answers about this issue, but these options didn't
There was a thread on this in comp.lang.javascript recently where victory was announced but
There exists the multisite plugin ( http://github.com/dasil003/rails-multisite/tree/master ) that allows for multiple view folders
There are many similar questions to this one, but they all ask about setting
There are plenty of questions and answers to this like this question but I
There is a reason why this method doesn't work? -(void)textViewDidBeginEditing:(UITextView *)textView { textView.text =
There is about 2000 lines of this, so manually would probably take more work
There are things like f.call(...) f.apply(...) But then there's this (1, alert)('Zomg what is
There is a number of topics on this problem around the web, but I

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.