Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.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 Person类未输出所需代码_Objective C_Lldb - Fatal编程技术网

Objective c Person类未输出所需代码

Objective c Person类未输出所需代码,objective-c,lldb,Objective C,Lldb,我不熟悉objective c编程,下面的程序生成lldb,但我不知道为什么。我试着混了一会儿,但没有任何效果。有人能帮忙吗 #import <Foundation/Foundation.h> @interface Person: NSObject { //Field variables int weight; int age; } //The methds along with their return type and arguments (if

我不熟悉objective c编程,下面的程序生成lldb,但我不知道为什么。我试着混了一会儿,但没有任何效果。有人能帮忙吗

 #import <Foundation/Foundation.h>

@interface Person: NSObject {

    //Field variables
    int weight;
    int age;
}

//The methds along with their return type and arguments (if they need them)
-(void) print;
-(void) setWeight: (int) w;
-(void) setAge: (int) a;
@end

@implementation Person

-(void) print {
    NSLog(@"My age is %i and I weigh %i", age, weight);
}

-(void) setWeight: (int) w {
    weight = age;
}

-(void) setAge: (int) a {
    age = a;
}
@end

int main( int argc, char *argv[]) {

    @autoreleasepool {
        Person *pav;

        pav = [[Person alloc] init];

        [pav setWeight: 145];
        [pav setAge: 19];
        [pav print];
    }

    return 0;

}

请发布stacktrace。@trojanfoe在左边它说这个argc int 1 argv char**0x7fff5fbff928 0x00007fff5fbff928,但我不太确定这是否是您要求在Xcode中运行项目的内容。等待它到达断点并在调试器控制台中键入bt,然后将输出添加到您的问题中。@trojanfoe lldb bt*线程1:tid=0xb5e8,0x0000000100000de6 mainmainargc=1,argv=0x00007fff5fbff928+22位于main.m:33,队列='com.apple.main thread',停止原因=断点3.1*帧0:0x0000000100000de6 mainmainargc=1,argv=0x00007fff5fbff928+22位于main.m:33 lldbOK,添加异常断点并重试。