标签:string ++ nss 问题 missing code ssi data nbsp
NSString的长度问题 pow(2, 15) 为啥要 -19
如下代码产生这个问题:
NSMutableString *ms = [NSMutableString string]; for (int i=0; i<pow(2, 15)-19; i++) { [ms appendString:@"1"]; } NSLog(@"%@ %ld", ms, ms.length);// 32749 NSLog(@"%ld", ms.length); [ms appendString:@"1"]; NSLog(@"%@ %ld", ms, ms.length);// 32750 NSLog(@"%ld", ms.length);
输出如下:
...1111 32749
2018-07-25 15:08:27.280985+0800 Demo[30718:219829] 32749
...1111 <decode: missing data>
2018-07-25 15:08:27.280985+0800 Demo[30718:219829] 32750
神一样存在的问题!!!
NSString 之谜: <decode: missing data>
标签:string ++ nss 问题 missing code ssi data nbsp
原文地址:https://www.cnblogs.com/pinweyshg/p/9366139.html