Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm new to iPhone development,i just want to get access token,i'm following this link http://www.stevesaxon.me/posts/2011/window-external-notify-in-ios-uiwebview/ to get that token,but when i call this delegate method,the WebView content is not loaded.

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

{

    _url = [[NSURL alloc] initWithString:@"URL"];
    if(_url)
    {

        if([_url isEqual:[request URL]])
        {
            return YES;
        }

        [_url release];
    }

    _url = [[request URL] retain];
    NSString* scheme = [_url scheme];

    if([scheme isEqualToString:@"acs"])
    {
        // parse the JSON URL parameter into a dictionary
        NSDictionary* pairs = [self parsePairs:[_url absoluteString]];
        if(pairs)
        {
            WACloudAccessToken* accessToken;
            accessToken = [[WACloudAccessToken alloc] initWithDictionary:pairs];
            [WACloudAccessControlClient setToken:accessToken];

            [self dismissModalViewControllerAnimated:YES];
        }

        return NO;
    }

    [NSURLConnection connectionWithRequest:request delegate:self];

    return NO;

}

Any ideas? Thanks in advance

share|improve this question
1  
Btw: If you are new to Objective-C start using ARC – HAS Apr 29 at 7:04

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.