In the program, I write a string that changes the boolean value to the opposite.

someObject.boolValue = ![someObject boolValue]; 

How can you write correctly (without dot-syntax) the left side of the expression. That is, using only square brackets?

    1 answer 1

    Can so

     [someObject setBoolValue:![someObject boolValue]]; 

    But it's better to replace it somehow with a separate method that will work with an internal variable, because in your example two messages are sent (setter + getter), although you can do with one.

    • 1101_debian, thank you very much, that's right! - AlexThumb