Last active
January 20, 2016 23:27
-
-
Save thornpig/e7f6d3b2d40fd2b11038 to your computer and use it in GitHub Desktop.
NSUInteger vs NSInteger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUInteger a = 0; | |
NSInteger b = 3; | |
NSInteger c = 1; | |
BOOL d = c >= a - b; //d is NO because a - b is implicitly converted to NSUInteger 4294967294 | |
NSString *string = @""; | |
BOOL e = c >= string.length - b; // e is NO because string.lenth returns NSUInteger. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment