OGeek|极客世界-中国程序员成长平台

标题: ios - xcode iOS每次检查url前缀 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 08:33
标题: ios - xcode iOS每次检查url前缀

我刚开始使用 Xcode,我需要一个简短的脚本来验证我的 url 前缀

在php中会是这样的

<?php
    $prefix1 = "loc:";
    if (Webview == $prefix1)
    {
        echo "Url Prefix is loc:";
    }
?>



Best Answer-推荐答案


NSURL *url = ...;
if ([[url scheme] isEqualToString"loc"]) {
    NSLog(@"Url Prefix is loc:");
}

关于ios - xcode iOS每次检查url前缀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24732788/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4