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
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.
Now in the implemetaion File you need to add the parent object to your function:
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
Again the startThread methode was declerated in another view.
I hope I could help you.