Table of Contents

valueWithCGSize

 
+ (NSValue *)valueWithCGSize:(CGSize)size;
 

Creates and returns an NSValue object that contains the value of a CGSize.

Return Value - A new NSValue object.

ObjC Sourcecode Example

    // ** Sample datatype **
    CGSize aSize = CGSizeMake(150.0f, 200.0f);
 
    // ** Add the value to nsvalue object **
    NSValue *cgSizeValue = [NSValue valueWithCGSize:aSize];
 
    // ** Output **
    NSLog(@"%@", cgSizeValue);

Output for this example code

2012-12-17 23:25:15.789 NSValueSample[353:11303] NSSize: {150, 200}