Thursday, January 21, 2010

Implementing TinyURL in your iPhone App..

This is a very simple task but I haven't seen it documented anywhere.


NSURL *url = [NSURL URLWithString:@"http://tinyurl.com/api-create.php?url=www.yoururl.com];

NSString *strUrl = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:nil];


Now use your strUrl pointer wherever you want the shortened URL.

No comments:

Post a Comment

Please be courteous when commenting on posts...