We found a following issue.
- After using following API, both the response handler and the error handler are call backed.
This occurs only on the Async API. The Sync API works fine.
-(void)findID:(id)objectID relationsDepth:(int)relationsDepth response:(void(^)(id result))responseBlock error:(void(^)(Fault *))errorBlock;
-
[iOS SDK version]
Backendless SDK v 1.21 for iOS and Mac OS X released 02.12.2015
https://github.com/Backendless/ios-SDK latest SDK 03.17.2015 -
Example Code
- (void)test_02_Data_08_RelationsFindIdAsync {
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
XCTestExpectation *documentOpenExpectation = [self expectationWithDescription:@"document open"];
RelationsAddress *address = [RelationsAddress addressWithStreet:@"TN 55" city:@"Lynchburg" state:@"Tennessee"];
RelationsContact *owner = [RelationsContact contactWithName:@"Jack Daniels" phone:@"777-777-777" age:147 title:@"Favorites" address:address];
RelationsPhoneBook *phoneBook = [RelationsPhoneBook phoneBookWithOwner:owner];
RelationsPhoneBook *savedPhoneBook = [backendless.persistenceService save:phoneBook];
NSLog(@"savedPhoneBook.objectId = %@", savedPhoneBook.objectId);
[[backendless.persistenceService of:[RelationsPhoneBook class]] findID:savedPhoneBook.objectId relationsDepth:2 response:^(RelationsPhoneBook *findId) {
NSLog(@"findId.objectId = %@", findId.objectId);
RelationsContact *findIdOwner = findId.owner;
XCTAssert([findIdOwner homeAddress] != nil && [[findIdOwner name] isEqualToString:[owner name]] && [findIdOwner age] == [owner age] && [[findIdOwner phone] isEqualToString:[owner phone]] && [[findIdOwner title] isEqualToString:[owner title]] );
[documentOpenExpectation fulfill];
} error:^(Fault *fault) {
NSLog(@"FAULT = %@ <%@>", fault.message, fault.detail);
XCTAssert(false);
}];
[self waitForExpectationsWithTimeout:10 handler:^(NSError *error) {
}];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
- Output
2015-03-17 14:37:18.686 backendless-test[1745:60b] savedPhoneBook.objectId = ACED52EC-80A7-870E-FF6F-56B7CC561000
2015-03-17 14:37:20.443 backendless-test[1745:60b] findId.objectId = ACED52EC-80A7-870E-FF6F-56B7CC561000
2015-03-17 14:37:20.453 backendless-test[1745:60b] FAULT = Unable to retrieve data - unknown entity <Unable to retrieve data - unknown entity>
Attached zip file contains the data models which used by above sample code.
Regards,
issue142.zip (8.05kB)