NSLog


NSLog(@"yoru log %d", variable)

%d, %D : 整数(int) %u, %U : 整数(unsigned int) %@ オブジェクトのdescriptionプロパティ

float

NSLog(@"%f",f);

double

NSLog(@"%f",d);

NSLange

NSLog(@"range %@", NSStringFromRange(range));

BOOL

NSLog(@"%@", StringFromBoolean(flag));

#define StringFromBoolean (return value ? @"YES" : @"NO")

'%d', 0 like false, 1 like true

BOOL b;
NSLog(@"Bool value: %d",b);

NSLog(@"value is %@",  flag ? @"Yes" : @"No");

CGPoint , CGRect, CGSize

NSLog(@"%@", NSStringFromCGRect(self.view.frame)); NSLog(@"%@", NSStringFromCGPoint(self.frame.origin)); NSLog(@"%@", NSStringFromCGSize(self.view.frame.size));

results matching ""

    No results matching ""