Fixed photoupload (request was utilized before finished)

This commit is contained in:
Roman Truba 2013-12-27 16:31:13 +04:00
parent f2fea42ec4
commit debebbd03a
5 changed files with 23 additions and 45 deletions

View File

@ -115,7 +115,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="YWF-ld-CDZ">
<rect key="frame" x="83" y="269" width="153" height="30"/>
<rect key="frame" x="84" y="269" width="153" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<state key="normal" title="Get new access token">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
@ -125,7 +125,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="pEX-xT-Axq">
<rect key="frame" x="84" y="307" width="153" height="30"/>
<rect key="frame" x="83" y="339" width="153" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<state key="normal" title="Force oauth">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
@ -138,6 +138,7 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" id="gAF-tH-eqo"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
<connections>
<segue destination="H8u-X9-tSm" kind="push" identifier="START_WORK" id="7UU-b0-KyZ"/>
</connections>

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>0F3C2DD4-510D-4DE2-9238-0259750D3AF6</string>
<key>IDESourceControlProjectName</key>
<string>VKSdkWorkspace</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>B54A4A7E-C593-43CB-97C6-3D45C5A84961</key>
<string>ssh://github.com/VKCOM/vk-ios-sdk.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>VKSdkWorkspace.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>B54A4A7E-C593-43CB-97C6-3D45C5A84961</key>
<string>..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/VKCOM/vk-ios-sdk.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>B54A4A7E-C593-43CB-97C6-3D45C5A84961</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>B54A4A7E-C593-43CB-97C6-3D45C5A84961</string>
<key>IDESourceControlWCCName</key>
<string>vk-ios-sdk-pub</string>
</dict>
</array>
</dict>
</plist>

View File

@ -35,5 +35,21 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "VKSDKTestApplication/VKSDKTestApplication/TestViewController.m"
timestampString = "409839795.786444"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "136"
endingLineNumber = "136"
landmarkName = "-uploadPhoto"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -47,9 +47,9 @@ extern inline BOOL VKStateTransitionIsValid(VKOperationState fromState, VKOperat
@end
@interface VKUploadImageOperation ()
@property (nonatomic, weak) VKUploadPhotoBase *uploadRequest;
@property (nonatomic, strong) VKUploadPhotoBase *uploadRequest;
@property (readwrite, nonatomic, assign) VKOperationState state;
@property (nonatomic, weak) VKRequest *lastLoadingRequest;
@property (nonatomic, strong) VKRequest *lastLoadingRequest;
@end
@implementation VKUploadImageOperation
@ -107,6 +107,8 @@ extern inline BOOL VKStateTransitionIsValid(VKOperationState fromState, VKOperat
- (void)finish {
self.state = VKOperationFinishedState;
self.uploadRequest = nil;
self.lastLoadingRequest = nil;
}
- (void)cancel {