NSObjectExtensions
public static class NSObjectExtensionsSupported platforms
Static Methods
ToObject(this NSObject)
public static object ToObject(this NSObject obj)Example
public bool TryGetValue(string key, out object value)
{
NSObject nsObj = null;
if (!this.ContainsKey(key))
{
value = null;
}
else
{
lock (this.obj)
{
// Retrieve a value key from the NSUserDefaults instance.
nsObj = this.standardUserDefaults.ValueForKey(new NSString(key));
}
// Converts the NSObject to the relevant .NET equivalent.
value = nsObj.ToObject();
}
return nsObj != null;
}Parameters
Returns
Last updated