[ios] Pass token by copy for async function.

This commit is contained in:
Alex Zolotarev 2016-01-11 08:51:59 +03:00 committed by Sergey Yershov
parent f48fb3960e
commit 1bfcfd2f88

View file

@ -99,10 +99,10 @@ typedef NS_OPTIONS(NSUInteger, MWMFieldCorrect)
return YES;
}
- (void)storeCredentials:(osm::ClientToken const *)token
- (void)storeCredentials:(osm::ClientToken)token
{
NSString * requestToken = @(token->m_key.c_str());
NSString * requestSecret = @(token->m_secret.c_str());
NSString * requestToken = @(token.m_key.c_str());
NSString * requestSecret = @(token.m_secret.c_str());
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
[ud setObject:requestToken forKey:kOSMRequestToken];
[ud setObject:requestSecret forKey:kOSMRequestSecret];
@ -177,7 +177,7 @@ typedef NS_OPTIONS(NSUInteger, MWMFieldCorrect)
{
[self stopSpinner];
if (result == osm::OsmOAuth::AuthResult::OK)
[self storeCredentials:&token];
[self storeCredentials:token];
else
[self showInvalidCredentialsAlert];
});