A strange thing is happening in my app. I have the following NSInteger
:
NSInteger *contentStart;
Then in viewDidLoad
, I did:
contentStart=0;
Then in another method, I did:
contentStart = contentStart + 20;
NSLog(@"%d", (int)contentStart);
The output is 160 instead of 20!
I tried everything, I even tried contentStart+=20
, which gives the same result.
Can anyone tell me what's going on here? I'm going crazy with this.
Many thanks.