NSString *searchString = @"Lyngbø";
NSLog("%@",[searchString stringByAddingPercentEscapeUsingEncoding:NSUTF8StringEncoding]);
Run Code Online (Sandbox Code Playgroud)
这给了我:Lyng%C3%B8
<script type="text/javascript">
document.write(escape("Lyngbø"));
</script>
Run Code Online (Sandbox Code Playgroud)
这给了我:Lyngb%F8
我正在开发的网络搜索引擎并不理解Objectiv C编码字符串的方式,并且在搜索包含任何一个字母的单词时不返回任何内容.ø或å
我打开了一个登录模式 UIViewController 并且在 60 秒内以模态方式显示第二个“谢谢”Viewcontroller 然后关闭它,但我可以弄清楚如何在 SWIFT 中执行此操作。(在Objectiv C中很容易)
这是我在关闭第一个后打开“Thank you viewcontroller”的代码。
weak var pvc = self.presentingViewController
self.dismiss(animated: true, completion: {
let thankYouExistingVC = self.storyboard?.instantiateViewController(identifier: "ThankYouExistingVC") as! ThankYouExistingVC
pvc?.present(thankYouExistingVC, animated: true, completion: nil)
})
Run Code Online (Sandbox Code Playgroud)