MonoTouch.Foundation.NSObject.FromObject Method
Boxes an object into an NSObject.

Syntax

public static NSObject FromObject (object obj)

Parameters

obj
A ECMA CLI object.

Returns

Boxed object or null if the type can not be boxed.

Remarks

This method can box the following types from a core runtime type to an NSObject type by boxing the values.

bool, char, sbyte, byte, short, ushort, int, int32, long, long64, float and double are boxed as NSNumbers.

IntPtr are boxed as NSValue containing a pointer.

System.Drawing.SizeF, System.Drawing.RectangleF, System.Drawing.PointF, MonoTouch.CoreGraphics.CGAffineTransform, MonoTouch.UIKit.UIEdgeInsets and MonoTouch.CoreAnimation.CATransform3D are boxed as an NSValue containing the corresponding type.

NSObjects and subclasses are returned as-is.

The null value is returned as an NSNull.

Requirements

Namespace: MonoTouch.Foundation
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0