iOS应用程序断点运行 [英] iOS app breakpoints on running

查看:235
本文介绍了iOS应用程序断点运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个经验丰富的开发人员,但是iOS / Objective C的新功能。

I'm an experienced developer, but new to iOS/Objective C.

下面的应用程序构建OK(模拟任何拼写错误或剪切错误) 。
当我运行它,它打破了打印方法,在某种程度上使它看起来像有一些错误。我看不出什么或错误在哪里。可能是一个真正的newby错误!

The app below builds OK (modulo any typo/cut'n'paste errors). When I run it, it breaks in the print method, in a way that makes it look like there is some error. I cannot see what or where the error is. Probably a real newby error though!

任何人都可以帮我解释我做错了,如何解决它?

Can anyone help me out by explaining what I am doing wrong and how to fix it?

这是一个命令行MacOS应用程序,与基金会,正在建设&在XCode中运行。

This is a command line MacOS app, with Foundation, being built & run in XCode.

@interface DayOfYear : NSObject
- (void) print;
- (id) init : (int) day;
@end // DayOfYear

@implementation DayOfYear

int dayInYr =0;

- (id) init : (int) day {
    self = [super init];
    dayInYr = day;
    return self;
}

- (void) print {
     // NSLog(@"In print with %d", dayInYr);

}    // WHEN RUN THIS IS WHERE IT BREAKPOINTS SAYING "Thread 1, breakpoint 1.1, 2.1


@end

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

    @autoreleasepool {

        // insert code here...
        NSLog(@"Hello, World!");

        DayOfYear *d =[[DayOfYear alloc] init : 2 ];
        [d print];


        NSLog(@"Finished!");

    }
    return 0;
}


推荐答案

print 方法上设置了两个断点,断点显示在左边您可以通过将它们拖出边距来摆脱它们,像这样:

You have two breakpoints set on the print method. Breakpoints are shown in the left margin as blue flags. You can get rid of them by dragging them out of the margin, like this:

这篇关于iOS应用程序断点运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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