use if with NSinteger?
问题 I WANT to use NSinteger variable *strength in my code with if condition but it's not work.. :( if(strength == 11){ } How can i use if with NSInteger* 回答1: NSInteger is a primitive value type; you don't really need to use pointers. So your declaration should read NSInteger strength; And not NSInteger *strength; However if you do need to use a pointer to an NSInteger (that is, NSInteger * ) for some reason, then you need to dereference the pointer to get the value: if (*strength == 11) { } but