All,
I have a method that takes a date (YYYY-MM-DD H:M:S) from the database and creates a URL with the year, month and day components from the date string. My solution works but I was wondering if there is a better way to do this? How are the cool kids doing it? :-)
Thanks!
-(NSString *) prettyURLFrom:(NSString *)dateString{
NSString * URLString = @"";
NSString *URL = @"http://www.theblues.com/featured/article/";
NSArray *myWords = [dateString componentsSeparatedByCharactersInSet:
[NSCharacterSet characterSetWithCharactersInString:@"-\" \" :"]
];
URLString = [NSString stringWithFormat:@"%@%@/%@/%@",
URL,
[myWords objectAtIndex:1],
[myWords objectAtIndex:2],
[myWords objectAtIndex:0]];
return URLString;
}