-3

I have a block of code that calls an NSTimer from a singleton class. this is Viewcontroller.m

-(IBAction) start
{
[[[ApplicationManager instance].ticker [[NSTimer scheduledTimerWithTimeInterval:1.0     target:self selector:@selector(showActivity) userInfo:nil repeats:YES]];

I have an error that says: Expected identifier Can anyone see why? or where i can add something to fix it? Thanks

4

2 回答 2

1

你会想要一本关于 Objective-C 的书,因为这一切都搞砸了。代码应该看起来像这样。(至少如果你想做我认为的那样)

- (IBAction) start
{
    [ApplicationManager instance].ticker = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(showActivity) userInfo:nil repeats:YES];
}

您在行首、计时器实例的开头和行尾有多余的括号,您缺少语句的右大括号,并且在ticker 和 [NSTimer..

于 2013-08-08T02:07:53.643 回答
-1

看起来你那里有一个错字。是的应该是

于 2013-08-08T01:59:12.807 回答