【问题标题】:How to get short URL inside my iPhone app?如何在我的 iPhone 应用程序中获取短 URL?
【发布时间】:2010-03-29 12:49:13
【问题描述】:

我需要从一个长 URL(我在我的应用程序中创建)中获取一个短 URL。我想我已经读过这个了,但是我在 SO 中找不到了。

任何人有一段代码或指示指出这一点?

最好的问候

【问题讨论】:

标签: iphone url short short-url


【解决方案1】:

我一般用这个,来自iCodeBlog的brandontreb

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

【讨论】:

    猜你喜欢
    • 2012-09-07
    • 2013-01-12
    • 1970-01-01
    • 1970-01-01
    • 2019-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多