Keď píšem
@implementation GameViewController
-(IBAction)StartGame:(id)sender{
StartGame.hidden = YES;
BirdMovement = [NSTimer scheduledTimerWithTimeInterval:0.05
target:self selector:@selector(BirdMoving) userInfo:nil repeats:YES];
}
-(void)BirdMoving{
Bird.center = CGPointMake(Bird.center.x, Bird.center.y - BirdFlight);
BirdFlight = BirdFlight - 5;
if (BirdFlight < -15) {
BirdFlight = -15;
if (BirdFlight > 0) {
Bird.image = [UIImage imageNamed:@"3.png"];
}
if (BirdFlight < 0) {
Bird.image = [UIImage imageNamed:@"4.png"];
}
}
-(void)touchesBegan:(NSSet *)touches withEvent: (UIEvent *)event{
BirdFlight =30;
}
píše sa, že používam nedeklarovaný identifikátor touchesBegan:
Prosím pomôžte mi :)
odpovede:
0 pre odpoveď č. 1Zabudli ste pravú zátvorku (}
) pre if (BirdFlight < -15)
vyhlásenie vo vašom BirdMoving
metóda.
V Xcode vyberte Upraviť > Vybrať všetko (alebo stlačte ⌘A). Potom vyberte Editor > Štruktúra > Znova odsadiť (alebo stlačte ovládanieja). Tým bude problém zrejmý.