Playlist Generator  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
Playlist2/URIToURLConverter.m
Go to the documentation of this file.
00001 //
00002 //  URIToURLConverter.m
00003 //  Playlist2
00004 //
00005 //  Created by Max Woolf on 18/12/2011.
00006 //  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
00007 //
00008 
00009 #import "URIToURLConverter.h"
00010 
00011 @implementation URIToURLConverter
00012 -(id)initWithSpotifyURI:(NSString *)URI
00013 {
00014     self->URI = URI;
00015     self = [super init];
00016     return self;
00017 }
00018 
00019 -(NSString *)convertToURL
00020 {
00021     NSString *baseURL = [[NSString alloc] initWithString:@"http://open.spotify.com/track/"];
00022     NSString *trackCode = [[URI componentsSeparatedByString:@":"]objectAtIndex:2];
00023     
00024     return [baseURL stringByAppendingString:trackCode];
00025 }
00026 @end