0

I have declared a BOOL and am flipping it's value when a user presses a button.

I do so like this: !self.isEditing;, but XCode warns me "Expression result unused"

Can this cause problems? Should I instead do: self.isEditing = !self.isEditing;?

General Grievance
  • 4,555
  • 31
  • 31
  • 45
retrodev
  • 2,323
  • 6
  • 24
  • 48

1 Answers1

0

When you run !self.isEditing, you're not actually changing the value of self.isEditing. So, yeah, you should use self.isEditing = !self.isEditing.

Ajay Tatachar
  • 383
  • 3
  • 16