diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index e139308a42d3270d9551aa2226b60dde2d52f1c1..179cee08748f65e5ac3b21983f606c01c50f262d 100644 Binary files a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m index c24e77be6832936df32c8f96778ffa86505f7351..0f12d0c09c6d894f14b4cde08a6e26b8e444efbc 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m @@ -133,24 +133,40 @@ - (void)syncSelectedObjectForDetailOnSuccess:(SuccessBlock)success { - // Load the image if necessary - if (_selectedObject.imageUrl && !_selectedObject.image) { - NSBlockOperation *blockOp = [NSBlockOperation blockOperationWithBlock: ^{ - NSURL *imageUrl = [NSURL URLWithString: _selectedObject.imageUrl]; - NSData *imageData = [NSData dataWithContentsOfURL: imageUrl]; - _selectedObject.image = [UIImage imageWithData: imageData]; - success(_selectedObject); - }]; - [blockOp start]; - } else { - success(_selectedObject); - } + // Call the server to get the children. + CISDOBAsyncCall *call = [self.serviceManager detailsForEntity: _selectedObject]; + // Assign this to a local var to get the compiler to copy it + SuccessBlock localSuccess = success; + call.success = ^(id result) { + // Update the UI + localSuccess(_selectedObject); + + // Load the image if necessary + if (_selectedObject.imageUrl && !_selectedObject.image) { + NSBlockOperation *blockOp = [NSBlockOperation blockOperationWithBlock: ^{ + NSURL *imageUrl = [NSURL URLWithString: _selectedObject.imageUrl]; + NSData *imageData = [NSData dataWithContentsOfURL: imageUrl]; + _selectedObject.image = [UIImage imageWithData: imageData]; + // Update the UI again + localSuccess(_selectedObject); + }]; + [blockOp start]; + } + }; + [call start]; + } - (void)syncSelectedObjectForNavigationOnSuccess:(SuccessBlock)success { - // TODO : Call the server to get the children. - success(_selectedObject); + // Call the server to get the children. + CISDOBAsyncCall *call = [self.serviceManager drillOnEntity: _selectedObject]; + // Assign this to a local var to get the compiler to copy it + SuccessBlock localSuccess = success; + call.success = ^(id result) { + localSuccess(_selectedObject); + }; + [call start]; } #pragma mark - Fetched results controller