RLMLinkingObjects circular dependency

I have a circular dependency problem: when using the new RLMLinkingObjects for feedback, I get the following error:

Type argument 'RCon *' does not satisfy the bound ('RLMObject *') of type parameter 'RLMObjectType'

I have two classes RCon and RSan. RCon has several references to RSan, and RSan refers to several RCon, so this is a many-to-many relationship. Here are examples of declarations for classes.

First grade:

//  RSan.h

#import <Realm/Realm.h>
#import <UIKit/UIKit.h>

@class RCon;

@interface RSan : RLMObject
@property (readonly) RLMLinkingObjects<RCon*>* cons;
@end
RLM_ARRAY_TYPE(RSan)

Another class:

//  RCon.h

#import <Realm/Realm.h>
#import <UIKit/UIKit.h>
#import "RSan.h"

@interface RCon : RLMObject
@property RLMArray<RSan*><RSan>* sans;
@end
RLM_ARRAY_TYPE(RCon)
+4
source share
1 answer

Objective-C. RLMArray , RLMObject. Objective-C @class .

, , - @interface , . :

#import <Realm/Realm.h>
#import <UIKit/UIKit.h>

@interface RCon : RLMObject
@end
RLM_ARRAY_TYPE(RCon)

@interface RSan : RLMObject
@end
RLM_ARRAY_TYPE(RSan)

@interface RCon()
@property RLMArray<RSan*><RSan>* sans;
@end

@interface RSan()
@property (readonly) RLMLinkingObjects<RCon*>* cons;
@end

. abobe .

+5

All Articles