tags:

views:

128

answers:

1

I need to get a short URL from a long one (that I made inside my app). I think that I already read about this, but I couldn't find it anymore here in SO.

Anyone has a piece of code or directions to point this out?

Best Regards

A: 

I usually use this one, from brandontreb of iCodeBlog

NSString *apiEndpoint = [NSString stringWithFormat:@"*API URL=*%@",link];
NSString *shortURL = [NSString stringWithContentsOfURL:[NSURL URLWithString:apiEndpoint]
encoding:NSASCIIStringEncoding
error:nil];
David Pollak