Struct NSError
Information about an error condition including a domain, a domain-specific error code, and application-specific information.
Implements
Inherited Members
Namespace: UnityEngine.XR.ARKit
Assembly: Unity.XR.ARKit.dll
Syntax
public struct NSError : IEquatable<NSError>
Remarks
This is a wrapper for Objective-C's NSError object.
Properties
code
Get the error code associated with this NSError.
Declaration
public long code { get; }
Property Value
| Type | Description |
|---|---|
| long |
Remarks
Error codes are domain-specific. See ToErrorDomain() and domain.
Refer to Apple's documentation for more information.
domain
Get a string containing the error domain.
Declaration
public string domain { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Refer to Apple's documentation for more information.
See Also
localizedDescription
Get a string containing the localized description of the error.
Declaration
public string localizedDescription { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Refer to Apple's documentation for more information.
localizedFailureReason
Get a string containing the localized explanation of the reason for the error.
Declaration
public string localizedFailureReason { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Refer to Apple's documentation for more information.
localizedRecoverySuggestion
Get a string containing the localized recovery suggestion for the error.
Declaration
public string localizedRecoverySuggestion { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Refer to Apple's documentation for more information.
Methods
AsIntPtr()
Gets the underlying Objective-C pointer.
Declaration
public IntPtr AsIntPtr()
Returns
| Type | Description |
|---|---|
| IntPtr | The native pointer. |
Equals(object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to test. |
Returns
| Type | Description |
|---|---|
| bool | Returns |
Overrides
Equals(NSError)
Determines whether other is equal to this one as determined by
isEqual:.
Declaration
public bool Equals(NSError other)
Parameters
| Type | Name | Description |
|---|---|---|
| NSError | other | The other NSError to test for equality. |
Returns
| Type | Description |
|---|---|
| bool | Returns |
GetHashCode()
Generates a hash code for this NSError.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for this instance. |
Overrides
Remarks
The hash code is generated using NSObject's hash property.
ToErrorDomain()
The domain as an NSErrorDomain enum.
Declaration
public NSErrorDomain ToErrorDomain()
Returns
| Type | Description |
|---|---|
| NSErrorDomain | Returns the NSErrorDomain of this NSError, or Unknown if the error domain could not be determined. |
Remarks
This method tries to determine the error domain without generating any managed strings. If the error domain is Unknown, you might still be able to get additional information from its string representation (domain).
ToString()
Generates a string representation of this NSError.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of this NSError. |
Overrides
Remarks
This method uses NSObject's description property to generate the string.
Operators
operator ==(NSError?, NSError?)
Tests for equality.
Declaration
public static bool operator ==(NSError? lhs, NSError? rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| NSError? | lhs | The nullable |
| NSError? | rhs | The nullable |
Returns
| Type | Description |
|---|---|
| bool | true if any of these conditions are met:
-
|
Remarks
This equality operator allows you to compare an instance with null to determine whether its
native pointer is null.
Examples
void TestForNull(NSError error)
{
// True if the native NSError object is null.
if (error == null)
{
// Do something with the error
}
}
operator ==(NSError, NSError)
Tests whether the underlying pointers for two NSError objects are the same.
Declaration
public static bool operator ==(NSError lhs, NSError rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| NSError | lhs | The instance to compare with |
| NSError | rhs | The instance to compare with |
Returns
| Type | Description |
|---|---|
| bool | true if the native pointers of |
Remarks
This only tests whether two NSErrors point to the same object in memory. Two different NSErrors could still be considered equal. See Equals(NSError).
operator !=(NSError?, NSError?)
Tests for inequality.
Declaration
public static bool operator !=(NSError? lhs, NSError? rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| NSError? | lhs | The nullable |
| NSError? | rhs | The nullable |
Returns
| Type | Description |
|---|---|
| bool | The negation of operator ==(NSError?, NSError?). |
operator !=(NSError, NSError)
Tests whether the underlying pointers for two NSError objects are different.
Declaration
public static bool operator !=(NSError lhs, NSError rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| NSError | lhs | The instance to compare with |
| NSError | rhs | The instance to compare with |
Returns
| Type | Description |
|---|---|
| bool | false if the native pointers of |
Remarks
This only tests whether two NSErrors point to different objects in memory. Two different NSErrors could still be considered equal. See Equals(NSError).