## NSInteger、NSUInteger

NSUInteger是无符号的，即没有负数,NSInteger是有符号的。

## NSNumber

``````NSInteger intVal = 123;
NSNumber *numberVal = [NSNumber numberWithInteger:intVal];

NSMutableArray* array = [NSMutableArray array];
[array addObject:intVal];    //错误，intVal不是一个对象类型
[array addObject:numberVal]; //正确</pre>
Cocoa提供了NSNumber类来包装（即以对象形式实现）基本数据类型。
<pre class="prettyprint">+ (NSNumber*)numberWithChar: (char)value;
+ (NSNumber*)numberWithInt: (int)value;
+ (NSNumber*)numberWithDouble:(double)value;
+ (NSNumber*)numberWithFloat: (float)value;
+ (NSNumber*)numberWithBool: (BOOL) value;
...
``````

``````- (char)charValue;
- (int)intValue;
- (float)floatValue;
- (double)doubleValue;
- (BOOL)boolValue;
...
``````

## NSValue类

NSNumber 继承自NSObject,可使用compare、isEqual等消息。 NSNumber是NSValue的子类。NSValue可包装任意类型值。
{"ft_lang_label":"__label__zh","ft_lang_prob":0.81197727,"math_prob":0.9951161,"size":1682,"snap":"2019-13-2019-22","text_gpt3_token_len":808,"char_repetition_ratio":0.16448152,"word_repetition_ratio":0.0,"special_character_ratio":0.16052319,"punctuation_ratio":0.24226804,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9764182,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-05-23T03:51:14Z\",\"WARC-Record-ID\":\"<urn:uuid:def62ec5-65d8-440e-9b10-0a5f1121d1f1>\",\"Content-Length\":\"10987\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:702a9a07-536a-418f-bcae-148a1de90ff8>\",\"WARC-Concurrent-To\":\"<urn:uuid:4faca3ba-7e81-4af8-a969-bec9c9f3f48d>\",\"WARC-IP-Address\":\"39.108.155.134\",\"WARC-Target-URI\":\"https://liuzhichao.com/p/1341.html\",\"WARC-Payload-Digest\":\"sha1:2PE3SLWBP3XB5HZWML3WH3XHF5HSJFPE\",\"WARC-Block-Digest\":\"sha1:JQI6WDTDIOQWALSOIQELFYAMTCPCIIUV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-22/CC-MAIN-2019-22_segments_1558232257002.33_warc_CC-MAIN-20190523023545-20190523045545-00165.warc.gz\"}"}