Incorrect NSStringEncoding value 0x0000 detected.

 

当一个字符串为null时,它不能被正常地使用,否则会报如下错误

Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future

错误案例:当nstrPublicUrl==null时,如果我们写下如下代码,就会报如上警告。

//错误的案例,nstrPublicUrl==nil时
NSString *nstrUrl = [NSString stringWithFormat:@"%@%@",nstrPublicUrl,ACCOUNT_URL];   

 

posted @ 2013-01-23 23:06  ygm900  阅读(1023)  评论(1编辑  收藏  举报