【发布时间】:2011-04-29 15:11:54
【问题描述】:
喂,
更改笔尖没有问题,但是当我在 OPGL ES 视图的笔尖文件中时,集成在此视图中的按钮将不起作用。当我按下一个时,应用程序崩溃了。
这是我如何将视图更改为第二个笔尖的代码:
- (IBAction)drawEAGLView:(id)sender {
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:@"settingsViewController" owner:self options:nil];
EAGLView* glView = [ nibViews objectAtIndex: 1];
self.view = glView;
[glView startAnimation];}
动画正在运行。
这是声明 Button 的 ViewController 的代码:
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
在这里,我向您展示了我是如何连接功能和插座的: http://s3.imgimg.de/uploads/screenshotConna91ea645png.png
如果您需要更多信息,请告诉我。
谢谢
【问题讨论】:
-
您将不得不提供更多信息。我只能建议你研究 XCode 创建的 OpenGL ES 示例项目,并尝试看看它和你的有什么不同。
-
很抱歉我没有提供足够的信息,但我已经改变了解决这个问题的方法,但我不知道如何编辑我的问题,或者我应该发布一个新问题吗?
-
好的,我设法编辑了这个问题 =)
标签: iphone cocoa-touch opengl-es rendering