I'd structure this a bit differently, since the entire logic is basically conditional:

```objc
if (x == lastValue || [x isEqual:lastValue]) {
    return NO;
} else {
    lastValue = x;
    return YES;
}
```