title: Schema validation failed: Property declared as origin of linking objects property is not a link
body: <p>I have two <code>RLMObject</code>s named <code>RCRealmUser</code> and <code>RCRealmLocation</code>. <code>RCRealmUser</code> has a one-to-one relationship defined on <code>RCRealmLocation</code> and <code>RCRealmLocation</code> has an inverse relation with the <code>RCRealmUser</code>. This is how I have defined these two:</p>
  
  <p><strong>RCRealmUser.h</strong></p>
  
  <pre><code>@interface RCRealmUser : RLMObject
  
  @property NSNumber &lt;RLMInt&gt; *userId;
  @property NSString *username;
  @property NSNumber &lt;RLMInt&gt; *countryCode;
  @property NSNumber &lt;RLMDouble&gt; *phoneNumber;
  @property NSString *fullName;
  @property NSString *profileImageURL;
  @property RCRealmLocation *location;
  
  - (id)initWithMantleModel:(RCUserProfile *)user;
  
  @end
  
  RLM_ARRAY_TYPE(RCRealmUser)
  </code></pre>
  
  <p><strong>RCRealmUser.m</strong></p>
  
  <pre><code>@implementation RCRealmUser
  
  + (NSString *)primaryKey {
      return @"userId";
  }
  
  + (NSArray *)indexedProperties {
      return @[@"fullName"];
  }
  
  + (NSDictionary *)defaultPropertyValues {
      return @{@"countryCode": @91};
  }
  
  - (id)initWithMantleModel:(RCUserProfile *)user {
      self = [super init];
      if(!self) return nil;
  
      self.userId = user.userId;
      self.username = user.username;
      self.countryCode = user.countryCode;
      self.phoneNumber = user.phoneNumber;
      self.fullName = user.fullName;
      self.profileImageURL = user.profileImageURL.absoluteString;
      self.location = [[RCRealmLocation alloc] initWithMantleModel:user.location];
  
      return self;
  }
  
  @end
  </code></pre>
  
  <p><strong>RCRealmLocation.h</strong></p>
  
  <pre><code>@interface RCRealmLocation : RLMObject
  
  @property (readonly) RLMLinkingObjects *userId;
  @property NSNumber &lt;RLMDouble&gt; *latitute;
  @property NSNumber &lt;RLMDouble&gt; *longitude;
  @property NSDate *timestamp;
  @property NSNumber &lt;RLMInt&gt; *accuracy;
  
  - (id)initWithMantleModel:(RCLocation *)location;
  
  @end
  
  RLM_ARRAY_TYPE(RCRealmLocation)
  </code></pre>
  
  <p><strong>RCRealmLocation.m</strong></p>
  
  <pre><code>@implementation RCRealmLocation
  
  + (NSArray&lt;NSString *&gt; *)indexedProperties {
      return @[@"timestamp"];
  }
  
  + (NSDictionary&lt;NSString *,RLMPropertyDescriptor *&gt; *)linkingObjectsProperties {
      return @{@"userId": [RLMPropertyDescriptor descriptorWithClass:RCRealmUser.class propertyName:@"userId"]};
  }
  
  - (id)initWithMantleModel:(RCLocation *)location {
      self = [super init];
      if(!self) return nil;
  
      self.latitute = location.latitute;
      self.longitude = location.longitude;
      self.timestamp = location.timestamp;
      self.accuracy = location.accuracy;
  
      return self;
  }
  </code></pre>
  
  <p>Now when I try to insert into <code>RCRealmUser</code> I encounter an error</p>
  
  <blockquote>
    <p>'RLMException', reason: 'Schema validation failed due to the following
    errors:</p>
    
    <ul>
    <li>Property 'userId' declared as origin of linking objects property 'userId' is not a link.'</li>
    </ul>
  </blockquote>
  
  <p>Am I doing something wrong somewhere?</p>