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.
any news?
Hi
Yes my code was working with earlier version of the Knives SDK (1.40.9)
-(void) retrieveUserBooksFromKinvey{ KCSLinkedAppdataStore* store= [KCSLinkedAppdataStore storeWithOptions:@{ KCSStoreKeyCollectionName : @"Libraries", KCSStoreKeyCollectionTemplateClass : [Libraries class]}]; KCSQuery *q2 =[KCSQuery queryOnField:@"libraryOwner._id" withExactMatchForValue:[KCSUser activeUser].userId]; [store queryWithQuery:q2 withCompletionBlock:^(NSArray *objectsOrNil, NSError *errorOrNil) { if (errorOrNil != nil) { } else { Libraries* library = objectsOrNil[0]; self.navigationItem.title=library.title; [_userBookArray addObjectsFromArray:[library.books allObjects]]; numberOfBooks =[NSString stringWithFormat:@"%ld", (long) (int) _userBookArray.count]; } [_userTableView reloadData]; }withProgressBlock:nil]; }
Hello Wood Wayfarer,
I have some additional questions and a request.
There is a later version of the iOS SDK v1.41.1 that may have fixed this problem. Please upgrade to this latest version of the SDK and let us know if this is still a problem or not.
If you are still seeing this issue, please send us the application source code related to this functionality so that we can review it?
When sending the source code, please provide the specific steps that you are using to reproduce the problem.
Regards,
Billy
Hi
v1.41.1 doesn't fix it.
I have two tables Libraries and Books and they have relation one-to-Many. So Libraries table has parameter books which include information about books in this library. For example:
[
{
"_collection": "Books",
"_id": "0435ADFA-A502-41A4-8F01-F92E9FAC61EC",
"_type": "KinveyRef"
},
{
"_collection": "Books",
"_id": "7AB8D211-1AA1-4EA1-9F29-1ED85F76A561",
"_type": "KinveyRef"
},
{
"_collection": "Books",
"_id": "9FC4D5FE-33EC-4D40-820F-C03FFA086EE1",
"_type": "KinveyRef"
}
]
I tried to get all books from library ( value books includes array of Books objects.) However all parameters of book object is equal nil except bookId.
This is my method to get books from library
-(void) retrieveUserBooksFromKinvey{ KCSLinkedAppdataStore* store= [KCSLinkedAppdataStore storeWithOptions:@{ KCSStoreKeyCollectionName : @"Libraries", KCSStoreKeyCollectionTemplateClass : [Libraries class]}]; KCSQuery *q2 =[KCSQuery queryOnField:@"libraryOwner._id" withExactMatchForValue:[KCSUser activeUser].userId]; [store queryWithQuery:q2 withCompletionBlock:^(NSArray *objectsOrNil, NSError *errorOrNil) { if (errorOrNil != nil) { } else { Libraries* library = objectsOrNil[0]; for(Books * book in library.books){ NSLog(@"%@", book.bookTitle); // title equal nil and other params too } self.navigationItem.title=library.title; [_userBookArray addObjectsFromArray:[library.books allObjects]]; numberOfBooks =[NSString stringWithFormat:@"%ld", (long) (int) _userBookArray.count]; } [_userTableView reloadData]; }withProgressBlock:nil]; }
Libraries.h
@interface Libraries : NSObject <KCSPersistable> @property (nonatomic, copy, readonly) NSString *libraryObjectId; @property (nonatomic, copy) CLLocation* libraryCoordinate; @property (nonatomic, copy) NSString *title; @property (nonatomic, retain) KCSUser *libraryOwner; @property (nonatomic, retain) NSMutableSet *books; @property (nonatomic, readonly) CLLocationCoordinate2D* coordinate; @property (nonatomic, readonly) CLLocation* coordinateForSearch; @property (nonatomic, copy, readonly) NSString *libraryOwnerName; @property (nonatomic, assign, readonly) double distanceToLibrary;
Libraries.m
@implementation Libraries - (NSDictionary *)hostToKinveyPropertyMapping { return @{ @"libraryObjectId" : KCSEntityKeyId, //the required _id field @"title" : @"name", @"libraryCoordinate" : KCSEntityKeyGeolocation, @"libraryOwner" : @"libraryOwner", @"books":@"books" }; } + (NSDictionary *)kinveyPropertyToCollectionMapping { return @{ @"libraryOwner" : KCSUserCollectionName ,@"books" : @"Books"}; } +(NSDictionary *)kinveyObjectBuilderOptions { // reference class map - maps properties to objects return @{ KCS_REFERENCE_MAP_KEY : @{ @"books" : [Books class]}}; }
Books.h
@interface Books : NSObject <KCSPersistable> //@protocol MKAnnotation <NSObject> // @optional // Title and subtitle for use by selection UI. @property (nonatomic, copy, readonly) NSString *bookObjectId; @property (nonatomic, copy) NSString *bookTitle; @property (nonatomic, copy) NSString *author; @property (nonatomic, copy) UIImage *bookCoverage; @property (nonatomic, copy) NSURL *bookCoverageURL; @property (nonatomic, copy) NSString *bookStatus; @property (nonatomic, copy) NSString *userIdSendRequestForBook;
Books.m
@implementation Books - (NSDictionary *)hostToKinveyPropertyMapping { return @{ @"bookObjectId" : KCSEntityKeyId, //the required _id field @"bookTitle" : @"title", @"author" : @"author", @"bookCoverage" : @"coverage" }; }
Hi Pranav .I cannot exclude field “libraryOwner” from the Libraries class. How its possible that it worked in previous version ? Looks like you didn't test this functionality. Did you try to reproduce it ?
Best Regards
Alex
Thanks,
Pranav
Kinvey Support
Pranav,
I cannot do this at the moment beacuse I have Development plan (
Thanks
Wood Wayfarer
Hi
I updated kinvey version from 1.40.9 to 1.41.0 and get issue. I have relation one-to-many (Labrary - Books). When I try to retrieve data I receive array of books but all attributes of books is nil.
Could you fix it, its critical issue for me?
Best Regards
Wood