Objective c Xcode预期表达式
我不断得到关于if(Start)==YES)行的错误预期表达式,我不确定如何修复它。提前谢谢你的帮助Objective c Xcode预期表达式,objective-c,Objective C,我不断得到关于if(Start)==YES)行的错误预期表达式,我不确定如何修复它。提前谢谢你的帮助 #import "SimpleTableViewController.h" @interface SimpleTableViewController () @end @implementation SimpleTableViewController -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ if (
#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
在上面的一行中,有1个起始括号和2个结束括号。
解决方案再添加一个起始括号或删除一个结束括号
if ((Start) == YES)
or
if (Start == YES)
起动后拆下闭合支架。对于每个结束括号,都必须有一个开始括号,反之亦然。您可能需要添加一些解释来改进您的答案。@Till,我认为一切都是显而易见的。如果你想添加一些内容,可以编辑我的答案。谢谢!下次我很少使用这个网站,也不太习惯这些潜规则,我一定会在我的问题中包含更多的信息。再次感谢您的快速响应将布尔变量与
YES
进行比较是错误的。BOOL还可以存储数字2、3、4。。。该值将等于TRUE
,但条件Start==YES
将给出FALSE
。所以条件应该是if(Start)
或if(Start!=NO)
@Cy-4AH我不知道启动的类型是什么。给他解决错误的方法。
if (Start) == YES)
if ((Start) == YES)
or
if (Start == YES)