summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2020-06-24 11:29:11 -0400
committerNicoleYarroch <nicole@livio.io>2020-06-24 11:29:11 -0400
commitd6fb4f15606bf53d5093b6f2ece598f48a4f72da (patch)
tree426da279e2d909eddc37946dab83e0bc246c937f
parent34bf0714193728c8f3e351960bc39ae38c9a166a (diff)
downloadsdl_ios-d6fb4f15606bf53d5093b6f2ece598f48a4f72da.tar.gz
Fixed reference to self in blocks
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink/SDLSoftButtonReplaceOperation.m21
1 files changed, 11 insertions, 10 deletions
diff --git a/SmartDeviceLink/SDLSoftButtonReplaceOperation.m b/SmartDeviceLink/SDLSoftButtonReplaceOperation.m
index 1e34308ad..85178807e 100644
--- a/SmartDeviceLink/SDLSoftButtonReplaceOperation.m
+++ b/SmartDeviceLink/SDLSoftButtonReplaceOperation.m
@@ -64,20 +64,21 @@ NS_ASSUME_NONNULL_BEGIN
[weakself finishOperation];
}];
} else if (![self sdl_allStateImagesAreUploaded]) {
- // If there are images that aren't uploaded
- // Send text buttons if all the soft buttons have text
+ // If there are images in the first soft button state that have not yet been uploaded, send a text-only version of the soft buttons (this will only happen if all the first button states have text)
[self sdl_sendCurrentStateTextOnlySoftButtonsWithCompletionHandler:^(BOOL success) {}];
- // Upload initial images
- __weak typeof(self) weakself = self;
+ // Upload images used in the first soft button state
+ __weak typeof(self) weakSelf = self;
[self sdl_uploadInitialStateImagesWithCompletionHandler:^{
- // Send initial soft buttons w/ images
- [weakself sdl_sendCurrentStateSoftButtonsWithCompletionHandler:^{
- // Upload other images
- [weakself sdl_uploadOtherStateImagesWithCompletionHandler:^{
- __strong typeof(weakself) strongself = weakself;
+ // Now that the images have been uploaded, send the soft buttons with images
+ __strong typeof(weakSelf) strongSelf = weakSelf;
+ [strongSelf sdl_sendCurrentStateSoftButtonsWithCompletionHandler:^{
+ // Finally, upload the images used in the other button states
+ __strong typeof(weakSelf) strongSelf = weakSelf;
+ [strongSelf sdl_uploadOtherStateImagesWithCompletionHandler:^{
+ __strong typeof(weakSelf) strongSelf = weakSelf;
SDLLogV(@"Finished sending other images for soft buttons");
- [strongself finishOperation];
+ [strongSelf finishOperation];
}];
}];
}];