Repository: realm/realm-swift
File: Realm/RLMObject.h (C/C++)

Code before:
-(instancetype)init;


/**
 Initialize a standalone RLMObject with values from an NSArray or NSDictionary
 
 Initialize an unpersisted instance of this object.
 Call addObject: on an RLMRealm to add standalone object to a realm.
 
 @see [RLMRealm addObject:]:
 */
- (instancetype)initWithObject:(id)object;


/**
 Helper to return the class name for an RLMObject subclass.
 
 @return    The class name for the model class.
 */
+ (NSString *)className;

/**
 Create an RLMObject within the default Realm with a given object.

 Creates an instance of this object and adds it to the default Realm populating
 the object with the given object.

 @param object  The object used to populate the object. This can be any key/value compliant
 object, or a JSON object such as those returned from the methods in NSJSONSerialization, or
 an NSArray with one object for each persisted property. An exception will be
 thrown if all required properties are not present or no default is provided.
 When passing in an NSArray, all properties must be present and valid.

 @see   defaultPropertyValues
 */
+(instancetype)createInDefaultRealmWithObject:(id)object;

/**
 Create an RLMObject within a Realm with a given object.
 
 Creates an instance of this object and adds it to the given Realm populating
 the object with the given object.
 
 @param realm   The Realm in which this object is persisted.
 @param object  The object used to populate the object. This can be any key/value compliant
                object, or a JSON object such as those returned from the methods in NSJSONSerialization, or
                an NSArray with one object for each persisted property. An exception will be
                thrown if all required properties are not present or no default is provided.
                When passing in an NSArray, all properties must be present and valid.
 
 @see   defaultPropertyValues

Review comment (suggestion):
Again, we're using the same word (object) to refer to two different things, so it's unclear what this does and how to use it.

> the object with the given NSArray or NSDictionary.


Code after:
-(instancetype)init;


/**
 Initialize a standalone RLMObject with values from an NSArray or NSDictionary
 
 Initialize an unpersisted instance of this object.
 Call addObject: on an RLMRealm to add standalone object to a realm.
 
 @see [RLMRealm addObject:]:
 */
- (instancetype)initWithObject:(id)object;


/**
 Helper to return the class name for an RLMObject subclass.
 
 @return    The class name for the model class.
 */
+ (NSString *)className;

/**
 Create an RLMObject in the default Realm with a a given object.

 Creates an instance of this object and adds it to the default Realm populating
 the object with the given object.

 @param object  The object used to populate the object. This can be any key/value compliant
 object, or a JSON object such as those returned from the methods in NSJSONSerialization, or
 an NSArray with one object for each persisted property. An exception will be
 thrown if all required properties are not present or no default is provided.
 When passing in an NSArray, all properties must be present and valid.

 @see   defaultPropertyValues
 */
+(instancetype)createInDefaultRealmWithObject:(id)object;

/**
 Create an RLMObject in a Realm with a given object.
 
 Creates an instance of this object and adds it to the given Realm populating
 the object with the given object.
 
 @param realm   The Realm in which this object is persisted.
 @param object  The object used to populate the object. This can be any key/value compliant
                object, or a JSON object such as those returned from the methods in NSJSONSerialization, or
                an NSArray with one object for each persisted property. An exception will be
                thrown if all required properties are not present or no default is provided.
                When passing in an NSArray, all properties must be present and valid.
 
 @see   defaultPropertyValues