Dot operator question


#1

In BNRLogger.m we use the following piece of code:

-(void)updateLastTime:(NSTimer *)t{
    NSDate *now = [NSDate date];
    [self setLastTime:now];
    NSLog(@"Just set time to %@", self.lastTimeString);
}

As far as I know, the dot operator is appropriate for getter/setter methods. In other cases we are supposed to use [].
So we should use [self lastTimeString] instead of self.lastTimeString.
However, the compiler doesn’t issue any error warnings for our code.
Can anybody explain why?


#2

[quote]However, the compiler doesn’t issue any error warnings for our code.
Can anybody explain why?[/quote]
That’s because, although syntactically different, they are functionally the same.


#3

Thanks for the answer, ibex10.