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.
if (errorOrNil == nil && objectsOrNil != nil) { //Code for success fetching }
else { //Code for error fetching }
} withProgressBlock:nil];
I always get this error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]'
What am I doing wrong? If no Event is related to any of the Invitations stored on Kinvey, I don't have this error. Do I have to implement any other method for translating the KinveyRef dictionary for the original Event entity? Thanks
What does your data look like? Does it have any malformed relationships? How do you create the reference dictionaries? Also can you provide the whole stack trace?
F
Fabrício Massula Dutra
said
almost 10 years ago
I simply got an error before the data is really dowloaded. Here's the stack:
2013-12-12 14:59:15.477 Zepig[1962:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]'
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Does this method [KCSLinkedAppStore queryWithQuery: withCompletionBlock: withProgressBlock:] is deprecated? There is a warning saying that it is now to use other method:
KCS_DEPRECATED(KCSResourceStore deprecated -- use +[KCSFileStore downloadFileByQuery:completionBlock:progressBlock:] instead, 1.18.0);
F
Fabrício Massula Dutra
said
almost 10 years ago
Another information I think it is important: I already save my Invitation object on kinvey with the kinveyRef dictionary for Events collection, but something is wrong when I fetch the Invitation object and the kinveyRef dictionary with the reference for Event property inside Invitation object. I just can't translate this reference:
Fabrício Massula Dutra
Model headers:
@interface Event : NSObject
@property (nonatomic, copy) NSString* entityId; //Kinvey entity _id
@property (nonatomic, copy) NSString* name;
@end
@interface Invitation : NSObject
@property (nonatomic, retain) Event* event;
@property (nonatomic, retain) NSString* objectId; //Kinvey entity _id
@end
Model implementations:
@implementation Event
- (NSDictionary *)hostToKinveyPropertyMapping {
return @{
@"entityId" : KCSEntityKeyId, //the required _id field
@"name" : @"name",
};
}
@end
@implementation Invitation
- (NSDictionary *)hostToKinveyPropertyMapping
{
return @{
@"objectId" : KCSEntityKeyId,
@"event" : @"event"
};
}
+ (NSDictionary *)kinveyPropertyToCollectionMapping {
return @{@"event" /* backend field name */ : @"Events" /* collection name for invitations */};
}
@end
The code for fetching is here:
KCSCollection *invitationCollection = [KCSCollection collectionFromString:@"Invitations" ofClass:[Invitation class]];
KCSLinkedAppdataStore *store = [KCSLinkedAppdataStore storeWithCollection:invitationCollection options:nil];
[store queryWithQuery:[KCSQuery query] withCompletionBlock:^(NSArray *objectsOrNil, NSError *errorOrNil) {
if (errorOrNil == nil && objectsOrNil != nil) { //Code for success fetching }
else { //Code for error fetching }
} withProgressBlock:nil];
I always get this error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]'
What am I doing wrong? If no Event is related to any of the Invitations stored on Kinvey, I don't have this error. Do I have to implement any other method for translating the KinveyRef dictionary for the original Event entity? Thanks