Using iPhone's NSURLConnection class

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Using iPhone's NSURLConnection class - Presentation Transcript

    1. Web Services Connection
    2. #1 NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@\"http://maps.google.com/maps/geo?output=json&q= %@” address, nil]]; NSString *data = [[NSString alloc] initWithContentsOfURL:url];
    3. #2 [NSThread detachNewThreadSelector: @selector(getJSON) toTarget:self withObject:nil];
    4. #3 NSURLRequest *request = [[NSURLRequest alloc] initWithURL: [NSURL URLWithString: @”http://www.google.com” ]]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; [connection release]; [request release];
    5. NSURLConnection - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response; - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data; - (void)connectionDidFinishLoading:(NSURLConnection *)connection;
    6. Problem • Every initialized NSURLConnection shares the same delegate methods, unless you delegate to different objects. • You could implement a class for holding all those these, but you need to create a object of that class for every download. Not good.
    7. My Approach
    8. http://github.com/leonho/iphone-libs

    + llchllch, 2 years ago

    custom

    4606 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 4606
      • 4606 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 6
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags