0
在我的腳本.m文件我不斷收到類似這樣的錯誤錯誤:麻煩和Xcode腳本
no declaration of property "newGameButton" found in interface
我也與「statsButton」和「settingsButton」得到這個。這裏是我的腳本:
#import "MainMenuViewController.h"
#import "Traffic_2AppDelegate.h"
#import "TrafficViewController.h"
@implementation MainMenuViewController
-(IBAction) newGame:(id)sender {
TrafficViewController* traffic = [[TrafficViewController alloc]
initWithNibName:@"TrafficViewController" bundle:nil];
[self.navigationController pushViewController:traffic animated:NO];
}
-(IBAction) showStats:(id)sender {
}
-(IBAction) showSettings:(id)sender {
}
- (void)viewWillAppear:(BOOL)animated {
[popAnimation setDuration:0.3];
[newGameButton setHidden:YES];
[statsButton setHidden:YES];
[settingsButton setHidden:YES];
[self performSelector:@selector(popView:) withObject:newGameButton afterDelay:0.25];
[self performSelector:@selector(popView:) withObject:statsButton afterDelay:0.3];
[self performSelector:@selector(popView:) withObject:settingsButton afterDelay:0.35];
}
@synthesize newGameButton, statsButton, settingsButton;
- (void)viewDidLoad {
[super viewDidLoad];
popAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
popAnimation.keyTimes = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.0],
[NSNumber numberWithFloat:0.7],
[NSNumber numberWithFloat:1.0], nil];
popAnimation.values = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.01],
[NSNumber numberWithFloat:1.1],
[NSNumber numberWithFloat:1.0], nil];
[popAnimation retain];
}
- (void)popView:(UIView*)view {
[view setHidden:NO];
[[view layer] addAnimation:popAnimation forKey:@"transform.scale"];
}
@end
什麼是你'@ interface'塊之前,包括
IBOutlet
這個班的樣子是? – Anomie 2011-03-19 02:36:33