NSStringFromから続くFunctionは非常に便利です。特にCGRect, CGPoint, CGSizeを出力したい場合も展開して出力するのは面倒です。


UIKit Function Reference — デベロッパドキュメント.jpg

NSStringFromCGRect, NSStringFromClassを使い次のように出力してみます。

// CGRect
NSLog(@"%@", NSStringFromCGRect([self.view bounds]));
// Class
NSLog(@"%@", NSStringFromClass([[[UIApplication sharedApplication] delegate] class]));

出力

2008-12-25 19:44:29.628 HelloWorld[39711:20b] {{0, 0}, {320, 460}}
2008-12-25 19:44:29.629 HelloWorld[39711:20b] HelloWorldAppDelegate

No comments yet.

Leave a comment

This is the comment form.

Recent Entry

Related posts