开发者

Find a function on objective c to write system messages as actionscript trace

I'm starting to learn Objective C and I wonder if there is any similar function to actionscript trace 开发者_运维百科to show messages in a console.

Any suggestion?


Each called method has implicit self (as object) and _cmd (as SEL) parameters. Hence you can do this in Foo class:

- (void)foo {
    NSLog(@"-[%@ %@] custom log", self, NSStringFromSelector(_cmd));
}

This is off top of my head. And, of course there are various macros defined for such shortcut. The one I'm using is from here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜