Проблема с Xcode Script - PullRequest
       2

Проблема с Xcode Script

0 голосов
/ 19 марта 2011

В файле .m в моем скрипте я получаю сообщение об ошибке, подобное этой:

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

1 Ответ

0 голосов
/ 19 марта 2011

У вас есть строка:

@synthesize newGameButton, statsButton, settingsButton;

Вы не показали нам файл интерфейса (.h), но я готов поспорить, что у вас нет объявления @property для newGameButton, statsButton или settingsButton. Они должны выглядеть примерно так:

@property(retain, nonatomic) UIButton *newGameButton;

если только они не предназначены для торговых точек, в этом случае вы также хотели бы включить IBOutlet непосредственно перед UIButton...

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...