Created
October 7, 2013 09:08
-
-
Save yaoxinghuo/6864849 to your computer and use it in GitHub Desktop.
ObjectiveC 中NSDictionary中 NSNumber 和 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
//NSDictionary中 储存 NSInteger 不是对象,所以存过去的时候,都转换成了 NSNUmber 了 | |
//需要转换成 NSInteger: | |
[change setValue:[NSNumber numberWithInteger:3] forKey:@"new"]; | |
NSInteger val = [[change objectForKey:@"new"] intValue]; | |
NSLog(@"%d",(int) val); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment