新的 Objective-C 程序员在这里尝试创建一个可变的字符串数组。
imageNames = [NSMutableArray arrayWithObjects: @"Yellow1.png",@"Yellow2.png",@"Yellow3.png","Yellow4.png","Yellow5.png","Yellow6.png",
"Yellow7.png","Yellow8.png", nil];
for (NSString *name in imageNames) {
NSLog(@"%@", name);
}
(lldb)
运行后,我在输出日志和 aa 中收到Thread 1: EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN, address = 'xxxxxxx'
字符串数组是否设置正确,是什么导致它无法打印出数组中的字符串?