I am new to objective c and I am trying to change the value of a global integer in objective c but the compiler is complaining with the following message: “lvalue require as left operand of assignment”.
Here is the line of code:
[[UIApplication sharedApplication].delegate someNSIntegerValue] = myNSIntegerValue;
I am sure the answer to this is simple, so simple in fact that I cannot find an answer for what I am doing wrong.
As Thomson Corner has already said,
someNSIntegerValueis probably a getter. But even if it was not, what you are doing there can not possibly work, because it translates to this:or in C
This hopefully makes clear that its wrong. What you could try:
Or the property-ish way (in case you @synthesize’d one):
Note that the last example should actually do the same as the one before that.