0

是否有可能使用外键连接两个端点结果。

End Point 1 :
{"series":[{"id":2,"name":"My Series","role":"student","student_id":15,"instructor_ids":[13],"sequential":false,"series_id":1,"user_assignment_ids":[3,4]}]} 

End Point 2 :
{"Assignments":[{ "id":3,"Name":"Assignment1", "seriesID":2},{ "id":4,"Name":"Assignment1","seriesID":2},{ "id":6,"Name":"Assignment1","seriesID":null}]}

在以上两个端点中,我有外键“user_assignment_ids”。

@class UserAssignment;
@interface UserSeries : NSManagedObject

@property (nonatomic, retain) NSNumber * id;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * role;
@property (nonatomic, retain) NSNumber * sequential;
@property (nonatomic, retain) NSNumber * seriesID;
@property (nonatomic, retain) NSNumber * studentID;
@property (nonatomic, retain) id userAssignmentIDS;
@property (nonatomic, retain) NSSet *userAssignment;
@end

@interface UserSeries (CoreDataGeneratedAccessors)

- (void)addUserAssignmentObject:(UserAssignment *)value;
- (void)removeUserAssignmentObject:(UserAssignment *)value;
- (void)addUserAssignment:(NSSet *)values;
- (void)removeUserAssignment:(NSSet *)values;

@end

@class UserSeries;

@interface UserAssignment : NSManagedObject

@property (nonatomic, retain) NSNumber * assignmentID;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSNumber * seriesID;
@property (nonatomic, retain) UserSeries *userSeries;

@end

谁能告诉我使用外键进行两个端点连接的可能方法?

4

1 回答 1

0

您用于RKConnectionDescription执行外键映射。此处的文档页面上有许多示例和指南。

于 2013-08-02T11:04:22.577 回答