Objective-C (iOS): デバッグコンソールにトレース出力

Objective-C: LogViewController.h

#import <UIKit/UIKit.h>

@interface LogViewController : UIViewController

@end

Objective-C: LogViewController.m

#import "LogViewController.h"

@interface LogViewController ()

@end

@implementation LogViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    NSLog(@"hoge");
    
    int debug = 3;
    float debugf = 4.0f;
    double debugd = 5.0f;
    NSLog(@"nums: %d %f %f", debug, debugf, debugd);
    
    NSString *name = @"test";
    NSLog(@"objects: %@ %@", name, [self description]);
}

@end

Output:

2013-01-03 01:49:02.607 Snippets[3609:c07] hoge
2013-01-03 01:49:02.609 Snippets[3609:c07] nums: 3 4.000000 5.000000
2013-01-03 01:49:02.610 Snippets[3609:c07] objects: test <LogViewController: 0x7192770>