我创建了一个新的单视图项目来测试它。在我的 ViewController.m 里面是代码:
我不确定为什么当我将编译源设置为 ObjectiveC++ 时会出现此错误?char 数组的初始化字符串太长
static const char _basex[3] = "12"; <-This is always ok
static const char _basex2[2] = "12"; <-Gives the initializer error when compiler set to Objective-C++
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}