static NSString * const testString = @"google";

//表示testString这个指针不能被修改,如若对testString赋值则会报错:testString = @"hello";编译器会报错

 

static NSString const *testString = @"google";

//表示testString指向对对象不能被修改,testString指针本身可以被修改:此时 testString = @"hello"; 编译器不会报错

 

http://stackoverflow.com/questions/6828831/sending-const-nsstring-to-parameter-of-type-nsstring-discards-qualifier

posted on 2015-09-09 14:34  ximenchuixie  阅读(157)  评论(0编辑  收藏  举报