今天调试程序,出现了如下错误 2014-01-20 16:53:13.311 Quiz[3346:70b] Cannot find executable for CFBundle 0x8a776e0 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/AccessibilityBundles/CertUIFramework.axbundle> (not loaded)
stackoverflow上给的答案是:click iOS Simulator > Reset Content and Settings... and run again. 但我的模拟器只有一个“还原内容和设置”,而且我还原了好几次,程序依然报同样的错
所以我想请问一下如何将iOS模拟器改为英文版本?或者说还有什么办法可以解决问题么?
这跟英文版本与否没关系,你系统切换成英文的模拟器自然就变成英文的了,然后模拟器里面的操作系统你也可以自己选择语言,跟iPhone是一样的。
你的Xcode重启过么?电脑重启过么?
好吧,代码特简单(新建了一个Single View Application工程,定义什么的都跳过了): - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
questions = [[NSMutableArray alloc] init];
answers = [[NSMutableArray alloc] init];
[questions addObject:@"What is 7 + 7?"];
[answers addObject:@"14"];
[questions addObject:@"What is the capital of Vermont?"];
[answers addObject:@"Montpelier"];
[questions addObject:@"From what is cognac made?"];
[answers addObject:@"Grapes"];
}
return self;
}
- (IBAction)showQuestion:(id)sender {
currentQuestionIndex++;
if (currentQuestionIndex == [questions count]) {
currentQuestionIndex = 0;
}
NSString *question = [questions objectAtIndex:currentQuestionIndex];
NSLog(@"displaying question:%@", question);
[questionField setText:question];
[answerField setText:@"???"];
}
(IBAction)showAnswer:(id)sender { NSString *answer = [answers objectAtIndex:currentQuestionIndex];
[answerField setText:answer]; }
现在不知道为什么不报错了,但是调用showQuestion方法后输出结果跟报错时一样 displaying question:(null)
正常情况下的输出应该是 displaying question:(加一个问题)