初学者:为什么我会获得EXC不良访问权限? [英] Beginner: Why do I get a EXC BAD ACCESS?

查看:43
本文介绍了初学者:为什么我会获得EXC不良访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击"self.myData = ..."行时出现异常

I am geting an exception while hitting the line "self.myData = ..."

GDB程序收到信号:EXC_BAD_ACCESS

GDB Program received signal: EXC_BAD_ACCESS

这是我的代码:

- (void)viewDidLoad {
    [super viewDidLoad];    
    self.myData = [NSArray arrayWithObjects:
                   [NSArray arrayWithObjects: 
                    @"Boroughs", 
                    [NSArray arrayWithObjects: 
                     @"Kings", 
                     @"Bronx", 
                     @"Manhattan", 
                     @"Queens", 
                     @"Staten Island", 
                     nil], 
                    nil],
                   [NSArray arrayWithObjects: 
                    @"Surrounding Counties", 
                    [NSArray arrayWithObjects: 
                     @"Westchester", 
                     @"Nassau", 
                     @"Suffolk", 
                     "@Fairfield", 
                     nil], 
                    nil],
                   nil];
}

推荐答案

我会说您的问题出在字符串"@Fairfield"上,除非这是一个错字,并且在您的源文件中是正确的.

I'd say your problem is with the string "@Fairfield", unless that is a typo here and correct in your source file.

这篇关于初学者:为什么我会获得EXC不良访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆