Search code examples
iphoneobjective-cios4

How to print or log the value of CGSize object?


I was trying to log (print) the value of CGSize object like this:

CGSize sizeOfTab = CGSizeMake(self.frame.size.width/tabCount, 49);

NSLog(@"size of tab is %@",sizeOfTab);

Is there anything wrong in this code; my app is crashing while control comes to NSLog statement.

Thanks Prasad


Solution

  • You can call the following to print the value you are after:

    NSLog(@"width = %f, height = %f", mySize.width, mySize.height);