开发者

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

开发者 https://www.devze.com 2023-02-19 20:31 出处:网络
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.

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

精彩评论

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