xcode - Why is my integer increasing by multiples of 4? -


i have if statement this

@property (nonatomic) nsuinteger *thescore; if (hint.hidden) { thescore += (2); } else { thescore += (1); } nslog(@"score changed"); score.text = [nsstring stringwithformat:@"%d", thescore]; 

but instead of thescore increasing 2 or 1 it's increasing 8 or 4

any ideas?

because it's pointer integer, not integer itself. 4 size of integer.

change nsuinteger thescore, without *.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -