Skip to content

Instantly share code, notes, and snippets.

@yaoxinghuo
Created October 7, 2013 09:08
Show Gist options
  • Save yaoxinghuo/6864849 to your computer and use it in GitHub Desktop.
Save yaoxinghuo/6864849 to your computer and use it in GitHub Desktop.
ObjectiveC 中NSDictionary中 NSNumber 和 NSInteger
//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