gpt4 book ai didi

iphone - '#' 字符 Twitter 在 ios 中发布 url

转载 作者:行者123 更新时间:2023-11-28 20:40:40 25 4
gpt4 key购买 nike

我正在尝试在 twitter 中自动发布一个带有“#”字符的 url,如下所示:

https://twitter.com/intent/tweet?related=palcomp3&text=Confira!!&url=http://palcomp3.com/avioesdoforro/#!/de-costa-mainha

但是 Twitter 会忽略 #

之后的所有内容

这是我试过的代码:

[webView setUrlAddress:[NSString stringWithString:@"https://twitter.com/intent/tweet?related=palcomp3&text=Confira!!&url=http://palcomp3.com/avioesdoforro/#!/de-costa-mainha"]];

[webView setUrlAddress:[NSString stringWithString:@"https://twitter.com/intent/tweet?related=palcomp3&text=Confira!!&url=http://palcomp3.com/avioesdoforro/%23!/de-costa-mainha"]];

最佳答案

很可能是由于编码问题,请尝试使用 stringByAddingPercentEscapesUsingEncoding 获取 URL 安全字符串,并将其用作 URL

NSString *str=[NSString stringWithString:@""https://twitter.com/intent/tweet?related=palcomp3&text=Confira!!&url=http://palcomp3.com/avioesdoforro/#!/de-costa-mainha"];
str=[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[webView setUrlAddress:str];

关于iphone - '#' 字符 Twitter 在 ios 中发布 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8703282/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com