NSValue UIKit Additions Reference

Inherits from
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 2.0 and later.
Declared in
UIGeometry.h

Overview

This category adds methods to the Foundation framework’s NSValue class. The methods in this category let you represent geometry-based data using an NSValue object.

Tasks

Creating an NSValue

Accessing Data

Class Methods

valueWithCGAffineTransform:

Creates and returns a value object that contains the specified affine transform data.

+ (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform
Parameters
transform

The value for the new object.

Return Value

A new value object that contains the affine transform data.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

valueWithCGPoint:

Creates and returns a value object that contains the specified point structure.

+ (NSValue *)valueWithCGPoint:(CGPoint)point
Parameters
point

The value for the new object.

Return Value

A new value object that contains the point information.

Availability
  • Available in iOS 2.0 and later.
Related Sample Code
Declared In
UIGeometry.h

valueWithCGRect:

Creates and returns a value object that contains the specified rectangle structure.

+ (NSValue *)valueWithCGRect:(CGRect)rect
Parameters
rect

The value for the new object.

Return Value

A new value object that contains the rectangle information.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

valueWithCGSize:

Creates and returns a value object that contains the specified size structure.

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

The value for the new object.

Return Value

A new value object that contains the size information.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

valueWithUIEdgeInsets:

Creates and returns a value object that contains the specified edge inset data.

+ (NSValue *)valueWithUIEdgeInsets:(UIEdgeInsets)insets
Parameters
insets

The value for the new object.

Return Value

A new value object that contains the edge inset data.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

valueWithUIOffset:

Creates and returns a value object that contains the specified offset data.

+ (NSValue *)valueWithUIOffset:(UIOffset)insets
Parameters
insets

The value for the new object.

Return Value

A new value object that contains the offset data.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIGeometry.h

Instance Methods

CGAffineTransformValue

Returns an affine transform structure representing the data in the receiver.

- (CGAffineTransform)CGAffineTransformValue
Return Value

An affine transform structure containing the receiver’s value.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

CGPointValue

Returns a point structure representing the data in the receiver.

- (CGPoint)CGPointValue
Return Value

A point structure containing the receiver’s value.

Availability
  • Available in iOS 2.0 and later.
Related Sample Code
Declared In
UIGeometry.h

CGRectValue

Returns a rectangle structure representing the data in the receiver.

- (CGRect)CGRectValue
Return Value

A rectangle structure containing the receiver’s value.

Availability
  • Available in iOS 2.0 and later.
Related Sample Code
Declared In
UIGeometry.h

CGSizeValue

Returns a size structure representing the data in the receiver.

- (CGSize)CGSizeValue
Return Value

A size structure containing the receiver’s value.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

UIEdgeInsetsValue

Returns an edge insets structure representing the data in the receiver.

- (UIEdgeInsets)UIEdgeInsetsValue
Return Value

An edge insets structure containing the receiver’s value.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIGeometry.h

UIOffsetValue

Returns an offset structure representing the data in the receiver.

- (UIOffset)UIOffsetValue
Return Value

An offset structure containing the receiver’s value.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIGeometry.h