strongloop-community / loopback-sdk-ios

iOS Client SDK for the LoopBack framework.
Other
76 stars 39 forks source link

Model Cascading and Model Collections #114

Open sanandrea opened 8 years ago

sanandrea commented 8 years ago

It seems it is not possible to automatically inflate the embedded models (cascade) or collection relationships. At the current status one should manually create the embedded models. e.g.

//Restaurant.h
@interface Restaurant : LBPersistedModel
@property (nonatomic, copy) NSString* phoneNumber;
@property (nonatomic, strong) Address* locationAddress;
@end

and

//Address.h
@interface Address : LBModel

@property (nonatomic, copy) NSString* city;
@property (nonatomic, copy) NSString* street;
@property (nonatomic, copy) NSString* state;
@property (nonatomic, copy) NSString* zipCode;

@end

When retrieving restaurant from server the address field is a NSDictionary.

sanandrea commented 8 years ago

@bajtos this other lib gave me some ideas of how to achieve this. Please take a look from line to line.

bajtos commented 8 years ago

Hello @sanandrea, thank you for filling this feature request. I think it's a valid one! Unfortunately we don't have bandwidth to implement it in the near future. Would you like to contribute this feature yourself?

sanandrea commented 8 years ago

@bajtos I have sort of implemented this, but I would like to know if there is another repo which is used to test the sdk features.

bajtos commented 8 years ago

I would like to know if there is another repo which is used to test the sdk features.

Not really, we usually write unit/integration tests to verify new features.

meashishvaid commented 6 years ago

@sanandrea Can you please suggest me how to implement this ? It would be great if you can provide some help.