Skip to content

Instantly share code, notes, and snippets.

@satoshin2071
Last active December 15, 2015 12:38
Show Gist options
  • Save satoshin2071/5261187 to your computer and use it in GitHub Desktop.
Save satoshin2071/5261187 to your computer and use it in GitHub Desktop.
NSLogまとめ
//そのobjがどのクラスに属するか
NSLog(@"%@",NSStringFromClass([obj class]));
//frame
NSLog(@"%@",NSStringFromCGRect(startFrame));
//メソッド名とクラス名と行番号
NSLog(@"%s #%04d", __PRETTY_FUNCTION__, __LINE__);
//インスタンスのクラス名
NSLog(@"%@", NSStringFromClass([self class]));
//メソッド名
NSLog(@"%@", NSStringFromSelector(_cmd));
//メソッド名とそのメソッドが属するクラス名
NSLog(@"%s", __func__);
NSLog(@"%s", __FUNCTION__);
NSLog(@"%s", __PRETTY_FUNCTION__);
//ソースファイル名
NSLog(@"%s", __FILE__);
//ソースファイル内の行番号
NSLog(@"%d", __LINE__);
//コールスタック
NSLog(@"%@", [NSThread callStackSymbols]);
//NSLog() で UIView 階層
NSLog(@"%@", [self.view recursiveDescription]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment