Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c EXC_错误访问错误_Objective C_Exc Bad Access - Fatal编程技术网

Objective c EXC_错误访问错误

Objective c EXC_错误访问错误,objective-c,exc-bad-access,Objective C,Exc Bad Access,当我从另一个类调用方法时,我得到错误: (踏板):EXC_坏_通道 这里是我在A班的方法: -(NSString*) parse: (NSString *) filePath { ////do something codeWriter* cd; cd = [[codeWriter alloc]init]; NSString* asmLine = [cd getAsmLine:lineContent]; ////here is my problem } 有人

当我从另一个类调用方法时,我得到错误:

(踏板):EXC_坏_通道

这里是我在A班的方法:

-(NSString*) parse: (NSString *) filePath
{
    ////do something
     codeWriter* cd;
     cd = [[codeWriter alloc]init];

    NSString* asmLine = [cd getAsmLine:lineContent]; ////here is my problem
}
有人能帮我理解错误是什么吗


谢谢

是的,这是我自己的课

我在类codeWriter中调用的方法:

-(NSString *)getAsmLine : (NSArray*) line {
    /////do something
    return string; }

该错误意味着您正试图访问坏内存补丁


数组“linecontent”在哪里初始化?我想在调用
getAsmLine:
方法时,“linecontent”数组不在内存中

codewriter
您自己的类吗?请提供相关数量的源代码以理解上下文。是的,codewriter是我自己的类。要为您提供什么?什么是“lineContent”,它是否在任何地方初始化?是的,lineContent是一个字符串(文件中的行),我从某个文件中读取所有行。我将文件中的行发送到CodeWriterClass中的getAsmLine方法。方法:getAsmLine-我发送该行,并在ASM(汇编)中获取translate。