The following protocols are available globally.
Protocol representing a BSON value. BSON is a computer data interchange format. The name “BSON” is based on the term JSON and stands for “Binary JSON”.
The following types conform to RLMBSON:
@protocol RLMCollection <NSFastEnumeration, RLMThreadConfined>
protocol RLMCollection : NSFastEnumeration, RLMThreadConfined
Objects of types which conform to
RLMThreadConfinedcan be managed by a Realm, which will make them bound to a thread-specific
RLMRealminstance. Managed objects must be explicitly exported and imported to be passed between threads.
Managed instances of objects conforming to this protocol can be converted to a thread-safe reference for transport between threads by passing to the
Note that only types defined by Realm can meaningfully conform to this protocol, and defining new classes which attempt to conform to it will not make them work withSee more
@protocol RLMThreadConfined <NSObject>
protocol RLMThreadConfined : NSObjectProtocol
RLMValue is a property type which represents a polymorphic Realm value. This is similar to the usage of
// A property on `MyObject` @property (nonatomic) id<RLMValue> myAnyValue; // A property on `AnotherObject` @property (nonatomic) id<RLMValue> myAnyValue; MyObject *myObject = [MyObject createInRealm:realm withValue:@]; myObject.myAnyValue = @1234; // underlying type is NSNumber. myObject.myAnyValue = @"hello"; // underlying type is NSString. AnotherObject *anotherObject = [AnotherObject createInRealm:realm withValue:@]; myObject.myAnyValue = anotherObject; // underlying type is RLMObject.
The following types conform to RLMValue: