你好 :) 我正在尝试创建一个静态的NSStrings C数组。
这是我尝试过的代码:
static NSString** polygonNames = {@"Radical Isotope", @"Point", @"Line", @"Triangle", @"Square", @"Pentagon", @"Hextagon", @"Heptagon", @"Octagon", @"Nonagon", @"Decagon", @"Hendecagon", @"Dodecagon", @"Tridecagon", @"Tetradecagon", @"Pentadecagon", @"Hexadecagon", @"Heptadecagon", @"Octadecagon", @"Enneadecagon"};
没有编译错误,但我收到了41个警告,所有这些警告都属于以下三种类型之一:
"warning: initialization from incompatible pointer type"
"warning: excess elements in scalar initializer"
"warning: (near initialization for 'polygonNames')"
我认为当我使用这个类时,会出现很多的sigbarts或其他内存访问错误...
如何正确地初始化一个静态NSString数组(最好是行内的,并且我想使用C数组,而不是NSArray)?