Xcode预期表达

时间:2014-02-11 08:09:15

标签: objective-c

我一直收到错误'关于if(开始)== YES)的预期表达式,我不知道如何修复它。感谢您提前获得所有帮助!

#import "SimpleTableViewController.h"

@interface SimpleTableViewController ()

@end

@implementation SimpleTableViewController

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{

if (Start) == YES)  {

    Intro1.hidden = YES;
    Intro2.hidden = YES;
    Intro3.hidden = YES;

    timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(BirdMove) userInfo:nil repeats:YES]

    Start = NO;
}
}

- (void)viewDidLoad
{
Start = YES;

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end

2 个答案:

答案 0 :(得分:2)

 if (Start) == YES)

在上面一行中你有1个起始支架和2个右括号。 解决方案添加1个起始括号或删除1个右括号。

 if ((Start) == YES)
 or

if (Start == YES)

答案 1 :(得分:0)

if (Start)
{
    Intro1.hidden = YES;
    Intro2.hidden = YES;
    Intro3.hidden = YES;

    timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(BirdMove) userInfo:nil repeats:YES]

    Start = NO;
}