As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Is there anywhere some sample working project with relational data that I can download and start with?
I tried to take a sample code from guides "Data Store" page and copy it to my solution.
The only changed I made are:
- changed the invitations property on Event to be (nonatomic, retain)
- allocated the NSMutableSet for invitations
- created an invitation and added it to event instance with addObject
After these changes I can't save the event due to the error 400 "The request body is either missing or incomplete".
Good morning Art,
Could you please provide me with a snippit of your code so we can take a look at it for you?
Thanks,
Hello Damien,
I solved it by replacing of KCSAppdataStore with KCSLinkedAppdataStore.
The guide is talking about this change by-the-way and it wasn't so obvious for me that I need to use an other storage provider...
But by the opportunity we are talking about, might I ask you an other question, please?
I've implemented the sample from the guide and mentioned the strange thing: despite of the hierarchy I've implemented, save of the Event object doesn't save the changed on the Invitations linked to the event. Is it correct behavior or I missed some thing?
The scenario I used is as following:
- created an invitation object and saved it with automatic id
- created an event object and added previously created invitation
- changed the status of the invitation
- saved the event
As a result event was saved with reference to the invitation but invitation status wasn't changed.
Art,
I'm glad that you figured it out. I'll note this as a deficiency in our guide for when we do an update to it in the future.
Thanks,
That's great )!
Any comments regarding to my question?
Art: With regards to your question, its hard to say definitively without seeing any of your code, but we believe that the item would be saved if you used the referenceKinveyPropertiesOfObjectsToSave method, which is outlined in the guide at http://devcenter.kinvey.com/ios/guides/datastore#relationaldatasaving
Did you use that method? If so can you share your code?
Thanks,
Regarding to your question: yes, I used this method with no changes in a result.
I've mailed you all sources of the project to the mail stated in the second post of the thread.
Thank you ahead for your help!
benspratling4
I have 2 ObjC classes. "A" and "B", both explicitly conform to KCSPersistable. They map to "A" and "B" collections on my backend, which exist and are populated. A has an @property for a "B". A's -hostToKinveyPropertyMapping has an entry for the "b" field (the local name and backend names are identical). It also has a +kinveyPropertyToCollectionMapping, which has the property name to collection name. I can save instances of A with a pointer to a live B and it works fine; I see what appear to be correct {'_type':'KinveyRef','_id':'...','_collection':'B'} on the backend: the collection names are correct and the _id's match the correct objects. Both the A and B instances were created by the user doing the fetching, and I haven't modified any ACL's yet. But when I fetch instances of A (from a KCSLinkedAppdataStore) I get NSDictionary's (__NSDictionaryM) instead of an instance of B. My whole point in doing this was that I could pull other properties of the B without doing a subsequent query. What ingredient am I missing for making simple 1-1 relational data work? am I missing an option when creating the store? I'm using KCSStoreKeyCollectionName:"A" and KCSStoreKeyCollectionTemplateClass:[A class]. The documentation tells me I don't need +referenceKinveyPropertiesOfObjectsToSave since I'm doing all of them, and save appears to work anyway. Documentation tells me I don't need +kinveyObjectBuilderOptions since these are not arrays (that's the next step once this one works), and implementing it didn't change the results. I'm building for iOS 8, (iPhone 6). The directory says I'm using KinveyKit 1.28.0, while it's Info.plist says I'm using KCSLibraryVersion : 1.5-SANDBOX.